Operator.Disconnect

Introduced

v4.0

Description

Disconnects all operator Ports. This operation is not undoable.

C# Syntax

Operator.Disconnect( Boolean );

Scripting Syntax

Operator.Disconnect( [Force] );

Parameters

Parameter Type Description
Force Boolean Force the disconnection of the operator even if it means deleting created objects.

Default Value: False

Examples

JScript Example

/*
	This example demonstrates how to create a runtime scripted operator and connect 
	it to the first cube, disconnect it, and then reconnect it to a second cube.
*/
// Update function for scripted operator
function MyOperator_Update( ctx, Out, InPolymsh ) 
{
	var aPos = InPolymsh.Value.Geometry.Points.PositionArray.toArray();
	Out.Value.Geometry.Points.PositionArray = aPos;
}
// Create a new scene with two cubes
NewScene( null, false );
var obj1 = CreatePrim( "Cube", "MeshSurface");
var obj2 = CreatePrim( "Cube", "MeshSurface");
// Create a runtime scripted operator
var scop = XSIFactory.CreateScriptedOp( "MyOperator", MyOperator_Update.toString(), "JScript" );
scop.AddIOPort( obj1.ActivePrimitive );
// Connect operator to obj1
scop.Connect( obj1 );
// Disconnect operator from obj1
scop.Disconnect();
// Reconnect operator to obj2
scop.Connect( obj2 );