Scripted operators can have variables as well as connections. Variables are custom parameters that belong to the scripted operator and can be used to control its effect. You can edit and animate variables just like any other custom parameter in a scene. In addition, the variable is available to the scripted operator in its calculations.
For example, if you create a custom deformation, you could define a variable to control the amplitude of the deformation. You can then animate the amplitude using keys, expressions, actions, and so on.
You manage variables in a similar way to connections, using the grid in the top pane of the scripted operator editor. To see variables, make sure to select Variables from the list in the upper left.
Make sure that Variables is selected in the list in the upper left of the scripted operator editor.
Click the New button. The Custom Parameter dialog box opens.
Specify a name, data type, default value, value range, and other options for the variable, then click OK. For more details see New Custom Parameter Dialog Box [Properties Reference].
The variable is displayed on a new row in the top pane of the scripted operator editor.
You can edit and animate the values of variables just like any other custom parameter.
In the scripted operator editor, click the Inspect button on the command bar.
In an explorer, select the Scripted Op node and press Enter.
Alternatively, choose any other command that displays the custom properties: Edit Properties Custom Properties, Edit Properties General Properties, Edit Properties All Properties, and so on.
In an explorer view, click the icon of the Scripted Op node.
To use the values of variables in your scripted operators, you must retrieve them. For example:
locVar = In_UpdateContext.Parameters("MyParam").Value ' Do something with locVar
You can also use the shorter form:
locVar = In_UpdateContext.MyParam.Value
You can edit the variable definition (name, range, and so on) in the same way as other custom parameters: by marking it then choosing Create Parameter Edit Parameter Definition from the Animate toolbar.
For more information see Editing Custom Parameter Definitions.
Except where otherwise noted, this work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License