Scripts
Millumin is able to execute JavaScript program to automate task on the computer, control software/hardware, get data from Internet, react to Millumin’s events …
Run your first Script
A script can be created from the +
button of the library
:
The created script can be found in the Scripts
group of the library:
Then, add this script to a layer and run it : the small light-icon remains green until the script finished. If your script is listening for some event, it could run endlessly, but you can stop it.
Lastly, you start editing the script to make it what you want :
Be sure to check the provided templates, as they shows various abilities of the scripts (using different functions for different purposes).
Another very handy feature is auto-completion : type a few characters (Mil
for example) to show the possibilities in terms of functions.
Functions
Control Millumin
These functions are prefixed by Millumin.
Exemple : Millumin.getLaunchedColumnName()
Here is the list :
- Columns
- getLaunchedColumnIndex()
- getLaunchedColumnName()
- launchColumn(indexOrName)
- launchOrStopColumn(indexOrName)
- stopColumn()
- launchPreviousColumn()
- launchNextColumn()
- Play
- play()
- pause()
- playOrPause()
- goToTime(time)
- goToTimelineSegment(name)
- Selection
- getCurrentBoardIndex()
- getCurrentBoardName()
- selectBoard(indexOrName)
- selectLayer(indexOrName)
- selectLight(indexOrName)
- Masters
- setMasterVideo(value)
- setMasterAudio(value)
- setMasterDMX(value)
- Brush
- setBrush(x, y, pressure)
- Project
- getCanvasSize(name)
- enterFullscreen()
- exitFullscreen()
- displayTestCard()
- hideTestCard()
- enableWorkspace()
- disableWorkspace()
- openProject(path)
- saveProject(nullOrPath)
- quit()
- Light
- getLightIntensity(indexOrName)
- setIntensity(indexOrName, value)
- Layer
- getLayerPosition(indexOrName)
- setLayerPosition(indexOrName, x, y)
- getLayerSize(indexOrName)
- getLayerOpacity(indexOrName)
- setLayerOpacity(indexOrName, value)
- getLayerScale(indexOrName)
- setLayerScale(indexOrName, value)
- getLayerRotation(indexOrName)
- setLayerRotation(indexOrName, value)
- getLayerMapping(indexOrName)
- setLayerMapping(indexOrName, arrayOfPoints)
- Media
- getLayerMediaTime(indexOrNameOfLayer)
- setLayerMediaTime(indexOrNameOfLayer, time)
- getLayerMediaNormalizedTime(indexOrNameOfLayer)
- setLayerMediaNormalizedTime(indexOrNameOfLayer, value)
- getLayerMediaSpeed(indexOrNameOfLayer)
- setLayerMediaSpeed(indexOrNameOfLayer, value)
- getLayerMediaText(indexOrNameOfLayer)
- setLayerMediaText(indexOrNameOfLayer, text)
- restartLayerMedia(indexOrNameOfLayer)
- pauseLayerMedia(indexOrNameOfLayer)
- restartOrPauseLayerMedia(indexOrNameOfLayer)
- stopLayerMedia(indexOrNameOfLayer)
- startMedia(indexOrNameOfLayer, indexOrNameOfMedia)
- getMediaProperty(indexOrNameOfLayer, indexOrNameOfMedia, propertyName)
- setMediaProperty(indexOrNameOfLayer, indexOrNameOfMedia, propertyName, value)
- importMediaFile(path, indexOrNameOfLayer, nullOrIndexOrNameOfColumn, startImmediately)
- removeMedia(indexOrNameOfLayer, indexOrNameOfColumn)
- Effects
- getEffectProperty(indexOrNameOfLayer, indexOrNameOfEffect, propertyName)
- setEffectProperty(indexOrNameOfLayer, indexOrNameOfEffect, propertyName, value)
- Data
- sendMIDI(nullOrDestination, command)
- sendOSC(senderNameOrAddressPort, command)
- sendDMX(senderName, command)
- sendString(senderNameOrAddressPort, command)
Events
These functions are prefixed by on
, suffixed by Event
and take always the event
parameter (a dictionary containing various infos).
Example : onMilluminEvent(event)
Here is the list :
- onBlobTrackerEvent(event)
- onArtnetEvent(event)
- onDMXEvent(event)
- onElectronicDeviceEvent(event)
- onGamePadEvent(event)
- onInternalSignalEvent(event)
- onKeyboardEvent(event)
- onKinectEvent(event)
- onKinect2Event(event)
- onLeapMotionEvent(event)
- onMIDIEvent(event)
- onMilluminEvent(event)
- onOSCEvent(event)
- onSACNEvent(event)
- onSkeletonTrackerEvent(event)
- onTimecodeEvent(event)
System
These do not have any prefix :
- log(message)
- setTimeout(callback, ms)
- setInterval(callback, ms)
- clearTimeout(timeout)
- runCommand(command)
- runAppleScript(script)
- getFileContents(path)
- getURLContents(url)
Interaction
If you prefer to run your show via an interactions, it is also possible.
Simply open the Interaction panel (CMD+M
), create an interaction and choose the action Run Script
:
This is very handy to create a shortcut for a specific set of actions in your project.