## CustomOperator

Object Hierarchy | Related C++ Class: CustomOperator

### Inheritance

SIObject

ProjectItem

Operator

CustomOperator

### Introduced

v4.0

### Description

The CustomOperator object represents a custom operator defined by the user. This operator may have been created in any of the following ways:
- in the Scripted Operator Editor
- as a Self-Installed Custom Operator
- on the fly by running a script (a "runtime" custom operator)
Self-Installed Custom Operators are defined within a Plugin and are the recommended way to create Custom Operators. Runtime operators are still supported but they have a different callback convention and embed the entire implementation of the operator into the scene file. See AddScriptedOp and XSIFactory.CreateScriptedOp for more details about runtime operators.
Prior to v5.1, Custom Operators were often created based on a Preset and SPDL file. This technique is still supported as a legacy feature but Self-Installed Custom Operators are now the recommended alternative.
The easiest way to build a Self-Installed Custom Operator from scripting is by using the AddCustomOp command, (or similar Parameter.AddCustomOp and ProjectItem.AddCustomOp methods).
It is also possible to build a custom operator using the methods of this object. For most operators there is only a single output object, (represented by a single OutputPort) and there may be inputs (represented by InputPorts). If the operator is a deform-style operator it must have both an output and an input to the same object. The output ports should be added before the input ports (or by using CustomOperator.AddIOPort). Most operators only need a single PortGroup, which is created automatically. A typical operator can be defined entirely with these methods:
- XSIFactory.CreateObject
- CustomOperator.AddInputPort
- CustomOperator.AddOutputPort
- XSIFactory.CreateParamDef
- CustomOperator.AddParameter
- Operator.Connect
More advanced operators, in particular ones that dynamically connect to objects after the operator has been created, also use the concept of PortGroup to organize the ports into groups as they are defined. These operators rely on CustomOperator.AddPortGroup, Operator.ConnectToGroup, and CustomOperator.AddInputPortByClassID.
Certain objects are explicitly blocked from being connected to custom operators, these include: X3DObject and Kinematics. Instead of connecting to these objects the operator should connect to the specific data underneath those objects, for example a Primitive, Property or KinematicState.
The actual algorithm of a Self-Installed Custom Operator is implemented in the Update callback. Unlike runtime operators it takes a single argument which is an OperatorContext object. Other callbacks include the Define, DefineLayout, Init, Term and the PPG Logic callbacks (PPGEvent for C# and OnClicked, OnInit, and OnTab).
For more information, see the Custom Operators topic.

### Methods

AddCustomOp | AddICEAttribute | AddIOPort | AddIOPortByClassID
AddInputPort | AddInputPortByClassID | AddOutputPort | AddOutputPortByClassID
AddParameter | AddPortGroup | AddScriptedOp | AddScriptedOpFromFile
AnimatedParameters2 | BelongsTo | Connect | ConnectToGroup
Copy | Disconnect | DisconnectGroup | EvaluateAt
GetICEAttributeFromName | GetInputValue | GetNumInstancesInGroup | GetNumPortGroups
GetNumPortsInGroup | GetPort2 | GetPort3 | GetPortAt
IsA | IsAnimated2 | IsClassOf | IsEqualTo
IsKindOf | IsLocked | IsSelected | LockOwners
PortAt | RemoveICEAttribute | RemoveParameter | SetAsSelected
SetCapabilityFlag | SetLock | SupportsBranchGroup | TaggedParameters
UnSetLock | Validate |  |

### Properties

AlwaysEvaluate | Application | BranchFlag | Capabilities
Categories | Code | Debug | EvaluationID
Families | FileName | FullName | Help
HierarchicalEvaluationID | ICEAttributes | InputPorts | IsConnected
Language | LockLevel | LockMasters | LockType
Model | Mute | Name | NestedObjects
ObjectID | Origin | OriginPath | OutputPorts
Owners | PPGLayout | Parameters | Parent
Parent3DObject | Port | PortGroups | Selected
Type |  |  |

### See Also

Parameter.AddCustomOp ProjectItem.AddCustomOp XSIFactory.CreateObject XSIFactory.CreateParamDef OperatorContext Operator AddCustomOp