scripted sequence

scripted sequence

scripted sequence provides the most power and flexibility for creating sequences, but requires creating a Python script which sets the states of all modules contained in the sequence.

The process for using this module is:

  1. Determine which modules’ output will be affected (controlled) by the Python script and therefore contained in one or more states.
  2. Connect the red output ports of those modules to scripted sequence instead of the viewer.
  3. Set the number of states and their names. This can be done manually or in a secondary Python script.
  4. Choose and set the State Control type (Slider, Combo Box, or List Box).
  5. Create and test the Python script which will control all modules, which must be set under Filename. A new script can be created from a default template.

Script Variables:

The script is run each time the current state changes. The following variables are available within the script:

  • NumberOfStates: the total number of states
  • StateNumber: the current state to set up
  • StateName: the name of the current state
  • N1, N2, N3, N4: user defined floating point numbers, set in the Variables group or through the Input Value ports

Ports

DirectionNameTypeDescription
InputInput ObjectsRenderableAny number of renderable objects to transform.
InputInput Value N1NumberA value to use as a variable.
InputInput Value N2NumberA value to use as a variable.
InputInput Value N3NumberA value to use as a variable.
InputInput Value N4NumberA value to use as a variable.
OutputCurrent State TitleStringText containing the title of the current state.
OutputOutput ObjectRenderableA renderable object displaying the transformed group.
OutputOutput Value N1NumberA value to use as a variable.
OutputOutput Value N2NumberA value to use as a variable.
OutputOutput Value N3NumberA value to use as a variable.
OutputOutput Value N4NumberA value to use as a variable.

Properties

PropertyTypeDescription
Allow RunBooleanDetermines whether the module is allowed to execute. Set to True to allow this module to run.
FilenameFileThe Python script which is run to set the current state contents.
ExecuteButtonForces the module to run. If this button is clicked and the application saved, the module will run when the application is loaded.
Current StateSequence StateThe current state to be passed to the script.
VisibilityVisibilityTurns on or off the visible state of the output objects.
Favorite In ExportBooleanInclude this sequence as a favorite when exporting to web scenes.
ChildrenObject listThe list of input objects that make up the sequence. The order can be rearranged within this list.

Sequence Options

PropertyTypeDescription
State ControlChoice: Slider, Combo Box, List BoxDetermines which style of control is used for selecting the current state.
Allow CyclesBooleanAllows the state control to be cycled in CTWS files.
State NamesString listThe names of each state used in the UI.

Variables

PropertyTypeDescription
Available VariablesString (read-only)Lists the variables available to the script during computation, such as StateNumber and StateName.
N1DoubleNumber passed into script.
N2DoubleNumber passed into script.
N3DoubleNumber passed into script.
N4DoubleNumber passed into script.