CustomOperator.RemoveParameter
 
 
 

CustomOperator.RemoveParameter

Introduced

v4.0

Description

Removes the specified Parameter from the custom operator.

C# Syntax

CustomOperator.RemoveParameter( Parameter in_pParam );

Scripting Syntax

CustomOperator.RemoveParameter( Parameter );

Parameters

Parameter Type Description
Parameter Parameter The parameter object to remove from the custom operator.

Examples

JScript Example

/*
        This example illustrates how to remove parameters from a custom operator
*/
NewScene( null, false )
var null1 = GetPrim( "null" );
// Create the operator
var sop = XSIFactory.CreateScriptedOp( "MySOP", MySOP_Update.toString(), "JScript" );
// Add the ports
sop.addoutputport( null1.posx );
// Add the parameters
var param1 = sop.AddParameter( XSIFactory.CreateParamDef2("text", siString, "hello") );
var param2 = sop.AddParameter( XSIFactory.CreateParamDef2("bool", siBool, true) );
var param3 = sop.AddParameter( XSIFactory.CreateParamDef2("int", siInt4, 10, 0, 100) );
var param4 = sop.AddParameter( XSIFactory.CreateParamDef2("dbl", siDouble, 0.5, 0.0, 1.0) );
// Connect the operator
sop.Connect();
// If you want to remove a parameter you must disconnect the operator first.
sop.Disconnect();
sop.RemoveParameter(param4);
// The operator's update function
function MySOP_Update( ctx, out )
{
        Application.LogMessage( "MySOP_Update: " + out.Value );
        // list operator's parameters
        var eParams = new Enumerator(ctx.operator.parameters);
        for ( ; !eParams.atEnd(); eParams.moveNext() )
        {
                var param = eParams.item();
                Application.LogMessage( param.Name + " = " + param.Value );
        }
        out.Value = ctx.CurrentFrame;
}