v1.5
operator
Moves an item after another in the stack.
MoveOperatorAfter( Object, OperatorToMove, OperatorReference ); |
| Parameter | Type | Description |
|---|---|---|
| Object | String | Specifies the object to be modified |
| OperatorToMove | String | Specifies the operator to be moved |
| OperatorReference | String | Specifies the operator to be moved after |
/*
This example creates several operators and then moves them in
the stack using the several options of MoveOperatorBefore.
*/
NewScene(null, null);
var oSphere = CreatePrim("Sphere", "MeshSurface", null, null);
// Create a twist operator in modeling construction mode
ApplyOp("Twist", oSphere, 3, siPersistentOperation, null, 0);
// Create a bend operator in animation construction mode
ApplyOp("Bend", oSphere, 3, siPersistentOperation, null, 2);
Application.LogMessage("Construction History Before Move");
var eOperators = new Enumerator( oSphere.ActivePrimitive.ConstructionHistory );
for (;!eOperators.atEnd();eOperators.moveNext())
{
var oOperator = eOperators.item();
logmessage( "\t"+oOperator.fullname );
}
// Move the twist operator after the bend operator.
MoveOperatorBefore("sphere.polymsh", "sphere.polymsh.twistop", "sphere.polymsh.bendop");
Application.LogMessage("Construction History Before After");
eOperators = new Enumerator( oSphere.ActivePrimitive.ConstructionHistory );
for (;!eOperators.atEnd();eOperators.moveNext())
{
var oOperator = eOperators.item();
logmessage( "\t"+oOperator.fullname );
}
//INFO : Construction History Before Move
//INFO : sphere.polymsh.secondaryshapemarker
//INFO : sphere.polymsh.animationmarker
//INFO : sphere.polymsh.bendop
//INFO : sphere.polymsh.shapemarker
//INFO : sphere.polymsh.modelingmarker
//INFO : sphere.polymsh.twistop
//INFO : sphere.polymsh.geom
//INFO : Construction History Before After
//INFO : sphere.polymsh.secondaryshapemarker
//INFO : sphere.polymsh.animationmarker
//INFO : sphere.polymsh.shapemarker
//INFO : sphere.polymsh.modelingmarker
//INFO : sphere.polymsh.twistop
//INFO : sphere.polymsh.bendop
//INFO : sphere.polymsh.geom
|