Here are a few of tips for working with scripted operators.
You can get information about scripted operators on transformation parameters and access them in the 3D views.
To see scripted operator relations in a viewport, click the eye icon on the viewport's menu bar and make sure that Relations is on:
If the selected object has transformation parameters that are driven by scripted operators, the label Scop is displayed in white to the right of the object's center.
Click on the label to see a list of the parameters that are driven by scripted operators. Click on a parameter in the list to open the scripted operator in the editor.
If the selected object has transformation parameters driven by scripted operators that involve other objects as input connections, those objects are linked to the selected object by dotted white lines.
You can click on a dotted line to see a list of transformation parameters that involve the linked object. You can also click on one of the parameters in the list to open the scripted operator in the editor.
To show animation cues in a viewport, click the eye icon on the viewport's menu bar and make sure that Animation Cues is on.
If the selected object has transformation parameters that are driven by scripted operators, a red triangle appears to the right of the object's center.
Click the triangle to see a list of transformation parameters that are driven by scripted operators, and click a parameter in the list to open the scripted operator in the editor.
For more information about animation cues in general, see Visual Cues for Animated Transformations [Animation].
You cannot use the animation icon to set a scripted operator on an R, G, or B color channel. Instead, you can do either of the following:
To test whether an object has a scripted operator on a parameter with a script, use the IsAnimated command:
bHasScrOp = IsAnimated(oMyObj, siScriptedOperatorSource, , )
With the object model, you can use the IsAnimated method:
bHasScrOp = oMyObj.IsAnimated(siScriptedOperatorSource)
To get the current frame, use the In_UpdateContext.CurrentFrame property. For example:
logmessage "Evaluating MyOp at frame: " & In_UpdateContext.CurrentFrame
You can also make an input connection to PlayControl.Current — that is the method that was used in previous versions before In_UpdateContext.CurrentFrame was available.
Normally, scripted operators are updated only when their input connections change values. To force your scripted operator to update at every frame change, click its icon in an explorer and activate Always Update.
To mute a scripted operator, click its icon in an explorer and activate Mute.
To display messages in the command history to help debug scripted operators, click its icon in an explorer and set Debug. Higher values display more verbose messages.
By declaring variables globally in the bottom pane of the scripted operator editor, you can improve the performance of your scripted operators.
Be careful to avoid name collisions between different operators as described in Subroutines, Variables, and Name Collisions.
Reference information about the objects, properties, and methods available in the object model, as well as about scripting commands, is available in the SDK Guide.
To display this information, press F1 or choose Help Scripting Reference from the command bar of the scripted operator editor. Methods and properties that you can use in a scripted operator are marked with an asterisk.
Except where otherwise noted, this work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License