v4.0
Connects an operator to the specified objects.
Operator.Connect( Object in_connections, siConstructionMode in_constructionmode ); |
Operator.Connect( [Connections], [ConstructionMode] ); |
| Parameter | Type | Description |
|---|---|---|
| Connections | Variant | Contains connection specification of objects to connect. |
| ConstructionMode | siConstructionMode |
The location in the construction stack where the operator should be created.
This only applies to output connections made to Geometry
objects; this mode will be ignored for all other types of connections.
Default Value: siConstructionModeDefault |
/*
This example demonstrates how to create and instantiate a runtime
custom operator and connect it to a cube.
*/
NewScene( null, false );
var obj = CreatePrim( "Cube", "MeshSurface");
function MyOperator_Update( ctx, out, in1 )
{
Application.LogMessage( "MyOperator_Update: " + out.Name );
var apos = in1.Value.Geometry.Points.PositionArray.toArray();
out.Value.Geometry.Points.PositionArray = apos;
}
var sop = XSIFactory.CreateScriptedOp( "MyOperator", "", "JScript" )
sop.AddOutputPort( obj.ActivePrimitive );
sop.AddInputPort( "cube.polymsh" );
sop.Code = MyOperator_Update.toString()
sop.Connect(); |
/* This example demonstrates how to instantiate the built-in Twist operator and connect it to a cube. */ NewScene( null, false ); var obj = CreatePrim( "Cube", "MeshSurface"); var op = XSIFactory.CreateObjectFromPreset( "Twist", "Operators" ); op.Connect(obj); |