Viz Pilot User Guide
Version 8.7 | Published September 25, 2023 ©
Execution Logic Editor
Execution Logic commands are saved as part of a template. This allows data elements based on the template to use the same execution logic commands.
For example, adding an execution logic script to the Media Sequencer command Take, will replace the Take command for all data elements based on that template.
A benefit of using Execution Logic is that the script can be run without the need for Director to be open. It is possible to utilize a limited set of commands - or any Viz Engine command - directly on the Media Sequencer to issue instructions or emulate button presses for each created Data Element.
This section contains the following topics:
Execution Logic Editor
The Execution Logic editor consists of three panes: a list of commands, a command editor and a list-view displaying syntax errors. The editor also has a search feature.
-
Command list: Displays the available commands. Available context menu options are Clear selected command and Clear all commands.
-
Clear selected command: Clears the execution logic for the selected command.
-
Clear all commands: Clears all execution logic for all commands.
-
-
Command editor: Displays the currently selected command and its execution logic. Available context menu options are Insert default action and Find.
-
Insert default action: Inserts the default command <ref>/logic/element/run</ref>.
-
Find (CTRL + F): Opens the Find tool.
-
-
Syntax error list: Displays any syntax errors in any of the commands. It is not possible to close the window with changes to any command before all syntax errors are resolved.
-
Find (CTRL + F): Searches the execution logic of the command that is currently open.
-
OK: Saves changes and closes the execution logic editor.
IMPORTANT! If the Execution Logic Editor is closed using the Exit button or by selecting File then Close, any changes will NOT be saved. In addition, if the template is saved and closed without first saving the execution logic, the execution logic will not be updated in the template.
-
Cancel: Close without saving.
-
XML tags suggestion dropdown: Type < to open the suggestion dropdown menu.
Enabling the Execution Logic Editor
-
Go to View > Execution Logic Editor
Adding Execution Logic to a Template
-
Open the .Execution Logic Editor v8.6.
-
Click on one of the existing commands (left pane).
-
Add the logic in the editor (right pane) and click OK.
Note: For more information on how to create execution logic, see the Media Sequencer manual on how to use the Media Sequencer’s logic building blocks.
Working with Execution Logic
Sending Basic Commands
The <viz> handler is used to send commands to the Viz Engine.
The following example sends the RENDERER SET_OBJECT SCENE*... command to channel “A” in the current profile:
<env viz=
"A"
>
<viz>RENDERER SET_OBJECT SCENE*...</viz>
</env>
Multiple commands can be sent by separating each command with <br/>, for example:
<viz>RENDERER SET_OBJECT ...<br/>RENDERER*STAGE START</viz>
Instead of setting the command directly, a more powerful approach is to use the contents of a field in the template. The field (a hidden textbox for instance) can then be filled with the Viz commands that need to be sent.
The example below shows how the contents of a data field in a data element can be retrieved by using the <ref> construct ("field_01" is the ControlObjectName of the data field):
<env viz=
"A"
>
<ref><var>element</var>/data/field_01</ref>
</env>
To send commands to several channels, duplicate the command:
<env viz=
"A"
>
<ref><var>element</var>/data/field_01</ref>
</env>
<env viz=
"B"
>
<ref><var>element</var>/data/field_02</ref>
</env>
Note: Forked execution is required when a channel contains multiple engines, otherwise the commands will only apply to the first engine in a channel.
Note: Execution logic will not work with non-control object based templates.
Example - Play, Continue, Take Out
This example shows how execution logic can be used to play an element, do a Continue after five (5) seconds, and then a Take Out after ten (10) seconds.
In the Execution Logic Editor, select the take command. Add the logic into the editor (right pane). This means that when a “take” is issued on a data element based on this template, the Media Sequencer will execute the logic.
The commands are modified to do a "take", "continue" and then an "out". The timecode for each operation must be set.
<relative>
<env command=
"take"
timecode=
"00:00:00:00"
>
<ref>/logic/element/run</ref>
</env>
<env command=
"continue"
timecode=
"00:00:05:00"
>
<ref>/logic/element/run</ref>
</env>
<env command=
"out"
timecode=
"00:00:10:00"
>
<ref>/logic/element/run</ref>
</env>
</relative>
Note: The running/outer context takes precedence over attributes on the “ref”. Instead of adding attributes on the “ref” node, use an “env” node as in the example above.
Example - Forked Execution
These examples show how the "take" command can be modified to make the template override the standard logic and instead send RENDERER*STAGE START.
Below, the command will be sent to the channel assigned to the data element:
<forked_exec>
<entry name=
"execution_group"
><var>channel</var></entry>
<viz>RENDERER*STAGE START</viz>
</forked_exec>
To send commands to a specific channel in the current profile, replace <var>channel</var> with the name of the channel you want to send to, as follows:
<forked_exec>
<entry name=
"execution_group"
>MY_CHANNEL</entry>
<viz>RENDERER*STAGE START</viz>
</forked_exec>
Example - Commands Generated by a Template
By using the information from the preceding examples, we can create logic that will send custom Viz commands that are generated by the template.
One way is to add a Value Control Component to the template, and set the ControlObjectName to "vizcmds". Next, create a regular script that sets the ControlValue of the TWValueControl to whatever command needs to be sent.
Alternatively, use a standard memo box and set the ControlObjectName to "vizcmds". Next, enter the Viz commands (or script what the contents are to be). The memo box’s visibility can be set to false so that it will not be visible to the user. In the Execution Logic you can then add the following:
<forked_exec>
<entry name=
"execution_group"
><var>channel</var></entry>
<viz>
<ref><var>element</var>/data/vizcmds</ref>
</viz>
</forked_exec>