Operator.Copy

Introduced

v4.0

Description

Creates a copy of the operator. Only the operator's parameter values are copied. If any of its parameters are driven by other sources (for example an FCurve) these are not copied.

C# Syntax

Operator Operator.Copy();

Scripting Syntax

oReturn = Operator.Copy();

Return Value

Operator

Examples

JScript Example

/*
	This example demonstrates how to copy an operator and connect it to another object.
*/
NewScene( null, false );
var sphere = CreatePrim( "Sphere", "MeshSurface" );
var cube = CreatePrim( "Cube", "MeshSurface" );
Translate( "Cube", 10, 0, 0, siRelative, siView, siObj, siXYZ );
// Apply the Bend operator to the sphere and change the angle
var bendop = ApplyOp( "Bend", sphere )(0);
bendop.angle.Value = 45;
// Copy the existing Bend operator (with the angle modification) and apply it to the cube
var bendop2 = bendop.Copy();
bendop2.Connect( "Cube" );
Application.LogMessage( bendop2.angle.FullName + "=" + bendop2.angle.Value );
// Expected result:
//INFO : cube.polymsh.bendop.angle=45