CustomOperator.Debug operator

導入

v4.0

詳細

カスタムオペレータにより定義されているデバッグフラグを Long として設定したり、戻したりします。値が 0 以外の場合は、オペレータの評価に関する追加情報のログが記録されます。

注:このプロパティはカスタムオペレータのアップデート関数から読み取れますが、プロパティの設定はできません。

C#構文

// get accessor

Int32 rtn = CustomOperator.Debug;

// set accessor

CustomOperator.Debug = Int32;

JScript の例

/*

	 This example illustrates how to use the debug property to 

	 test an operator. The message Notify is sent to an operator

	 to notify it that it's update ports are dirty. The RequestData

	 and Evaluate messages are sent when the output is requested.

	 The example below shows that the operator is only evaluated

	 once even if the time is changed. This is because the inputs

	 are not time dependent. Try setting a key on posy or

	 enabling the CustomOperator.AlwaysEvaluate property, this

	 forces the operator to re-evaluate on the second GetValue.

*/

NewScene( null, false );

var null1 = GetPrim( "null" );

var sop = null1.posx.AddScriptedOp( MyExpr_Update.toString(), null1.posy, "MyExpr","JScript" );

sop.Debug = 1;

// SetKey( null1.posy );

// sop.AlwaysEvaluate = true;

// Log the evaluated of posx

val = GetValue( null1.posx, 1 );

Application.LogMessage( "first evaluated value " +  val );

// Change the current frame

SetValue( "PlayControl.Current", 50 );

// Log the new evaluated of posx

val = GetValue( "null.kine.local.posx", 1 );

Application.LogMessage( "new evaluated value " +  val );

// Operator's update function.

function MyExpr_Update( ctx, out, in1 )

{

	Application.LogMessage( "MyExpr_Update: " + out.name );

	out.Value = ctx.CurrentFrame;

}