Applying or Connecting Your Custom Operator
Preset-based operators are applied or connected and runtime operators are connected.
To apply your preset-based custom operator
Once the SPDL is installed in XSI, you can instantiate your operator using the ApplyOp command:
var op = ApplyOp( "<op_name>", "<target>" );
|
For more information on using the ApplyOp command, see the Scripting Reference guide. |
To connect your preset-based custom operator
You can get a pointer to a custom operator via the XSIFactory.CreateObjectFromPreset method. You can then use the Operator.Connect method to connect it:
var target = ActiveSceneRoot.AddNull(); var cop = XSIFactory.CreateObjectFromPreset( "<op_name>" ); cop.Connect( target );
To connect your runtime custom operator
While you are creating your custom operator, you should get a pointer to the CustomOperator object. You can then use the Operator.Connect method to connect it:
var str = BuildCustomOp.toString(); var cop = XSIFactory.CreateScriptedOp( "<op_name>", str, "JScript" ); // ... cop.Connect();