DefineLayout コールバックを使用して自己インストール カスタム オペレータに特別なパラメータを定義でき、DefineLayout コールバックとともにこれらが表示されるプロパティ ページを調整できます。
// Add an Alpha parameter in the Define callback
CStatus MyOp_Define( CRef& in_ref )
{
Context ctxt( in_ref );
CustomOperator op( ctxt.GetSource() );
Factory fact = Application().GetFactory();
// Define the parameters
Parameter param;
CRef pdef = fact.CreateParamDef( L"Alpha", siDouble, CValue(0.5), CValue(0.01), CValue(0.99) );
op.AddParameter( pdef, param );
}
// Put the Alpha parameter in its own grouping
CStatus MyOp_DefineLayout( CRef& in_ref )
{
Context ctxt( in_ref );
PPGLayout layout( ctxt.GetSource() );
layout.Clear();
// Add a group for the Alpha parameter
layout.AddGroup( L"Intensity" );
layout.AddItem( L"Alpha" );
layout.EndGroup();
//...
}
// Add an Alpha parameter in the Define callback
function MyOp_Define( ctxt )
{
var op = ctxt.Source;
// Define the parameters
var pdef = XSIFactory.CreateParamDef2( "Alpha", siDouble, 0.5, 0.01, 0.99 );
var param = op.AddParameter( pdef );
// ...
}
// Put the Alpha parameter in its own grouping
function MyOp_DefineLayout( ctxt )
{
var layout = ctxt.Source;
layout.Clear();
// Add a group for the Alpha parameter
layout.AddGroup( "Intensity" );
layout.AddItem( "Alpha" );
layout.EndGroup();
//...
}
ランタイム(非自己インストール)オペレータの場合は、XSIFactory.CreateParamDef または Factory::CreateParamDef メソッドを使用して処理中に新しいパラメータを定義および作成することができます。
カスタム オペレータのパラメータはカスタム プロパティのパラメータに非常によく似ています。 ただし、FCurve または FCurve および GridData または GridData タイプ パラメータはサポートされません。
カスタム オペレータは、独自のパラメータを持つ代わりに、カスタム プロパティから入力接続を受けることができます。 これは、FCurve パラメータや GridData パラメータが必要な場合や、カスタム プロパティがシーンの深いところに隠されている 1 つまたは複数のオペレータをコントロールするための中心パネルとしての役割を果たしている場合に便利です。