To create a Master Controller, you must add a Master Controller node to the scene, then link it to a UI script, in which its widget and the way it interacts with elements in the scene will be programmed. The UI script of a Master Controller is executed when its controls are displayed.
- In the Node view, add a Master Controller node by doing one of the following:
- In the Node Library view, select the Misc filter, then drag and drop the Master Controller node from the Node Library view to the Node view.
- Right-click on the Node view and select Insert > Misc > Master Controller.
- Open the Node view menu and select Insert > Effects > Misc > Master Controller.
- Click on the yellow square in the Master Controller node to open its Layer Properties.
- Switch to the Script UI tab.
- In the scripting field of the Script UI tab, type in the following code to link to your widget script:
include(scene.currentProjectPath() + "/scripts/myScript.js");
In this example, the script is located in a scripts subfolder of the scene folder, and is named myScript.js.
- Save your scene.
- Open the Script Editor view by doing one of the following:
- From the top menu, select Windows > Script Editor.
- From any existing view (ie: the Camera or Drawing view), click on the Add View button and select Script Editor.
- In the Scope dropdown, select Project.
The script list will now list scripts in the scripts subfolder of your scene.
- In the Script Editor toolbar, click on the New Script button.
- In the New Script dialog, type in myScript and confirm.
- In the Save Script dialog, select Scene in the location dropdown and confirm.
The script scripts/myScript.js will be added to the list of scripts.
- Select scripts/myScript.js from the script list to load it in the editor.
You are now ready to start scripting a widget for the Master Controller node.