アニメーション
パラメータのファンクション カーブ情報を取得します。
注: このコマンドは、出力引数を使用します。 C#
および一部のスクリプト言語(JScript、PerlScript、Python
など)は、リファレンスによって渡される引数をサポートしていません。このため、状況に応じた適切な回避策を実行する必要があります。
スクリプト言語の場合、このコマンドは出力引数を取得するために使用できる ISIVTCollection を戻します。
C# の場合は、XSIApplication.ExecuteCommand
メソッドを使用してこのコマンドを呼び出すことができます。 ExecuteCommand は、出力引数を C# の
System.Object (出力引数の配列を含む)にパック化します(詳細については、「C#
からのコマンドの呼び出し」を参照)。
GetFCurveInfo( InputObj, [CurveKind], [ValueWhenNoKey], [NbKeys], [ExtrapolationKind], [DefaultSegKind], [LowClamp], [HighClamp] ); |
| パラメータ | タイプ | 詳細 | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| InputObj | 文字列 | ファンクション カーブのアニメーション ソース | ||||||||||||
| CurveKind | Integer | ファンクション カーブの種類を戻します。
|
||||||||||||
| ValueWhenNoKey | ダブル | キーがない場合は、ファンクション カーブの値を戻します。 | ||||||||||||
| NbKeys | Integer | キーの数を戻します。 | ||||||||||||
| ExtrapolationKind | Integer | ファンクション カーブのエクストラポレーション タイプを戻します。
|
||||||||||||
| DefaultSegKind | Integer | デフォルト セグメントの種類を戻します。 標準のファンクション カーブに適用されます。
|
||||||||||||
| LowClamp | ダブル | クランピング値の下限を戻します。 | ||||||||||||
| HighClamp | ダブル | クランピング値の上限を戻します。 |
dim source, fcurve
dim crvtype, nokeyval, nbKeys, extrap, seq, lowclamp, highclamp
GetPrim "Null"
' Save some keys on the X position of the Null object
SaveKey "Null.kine.local.posx", 1, -5.0
SaveKey "Null.kine.local.posx", 25, 7.0
SaveKey "Null.kine.local.posx", 50, 2.0
' Get the FCurve animation source
set source = GetSource( "Null.kine.local.posx", siFCurveSource )
for each fcurve in source
GetFCurveInfo fcurve, crvtype, nokeyval, nbKeys, extrap, seq, lowclamp, highclamp
Application.LogMessage "Number of keys : " & nbKeys
Application.LogMessage "Value when no keys : " & nokeyval
Application.LogMessage "Type of fcurve : " & crvtype
Application.LogMessage "Extrapolation type : " & extrap
Application.LogMessage "Default segment type: " & seq
Application.LogMessage "Lower clamp bound : " & lowclamp
Application.LogMessage "Upper clamp bound : " & highclamp
next
|
// This example illustrates how to get access to the output
// arguments returned by the GetFCurveInfo command.
// Commands that don't explicitly define a return value but have output
// arguments in fact have an implicit return value which contains collection
// object ( IVTCollection ). The .value is a method on this object.
// Create scene
NewScene("",false);
GetPrim("Null", null, null);
SetValue("null.Name", "null", null);
CreatePrim("Arc", "NurbsCurve", null, null);
SelectObj("null", null, true);
ApplyCns("Path", "null", "arc", null);
SaveKey("null.kine.pathcns.perc", 1, 0, null);
LastFrame();
SetValue("null.kine.pathcns.perc", 100, null);
SaveKey("null.kine.pathcns.perc", 100, 100, null);
// Get the fcurve from a string path
var col = GetSource("null.kine.pathcns.perc");
var src = col(0);
// Get the fcurve info
var vtcol = GetFCurveInfo( src );
// Dump the fcurve info
Application.LogMessage( "CurveKind = " + vtcol.value("CurveKind") );
Application.LogMessage( "ValueWhenNoKey= " + vtcol.value("ValueWhenNoKey") );
Application.LogMessage( "NbKeys= " + vtcol.value("NbKeys") );
Application.LogMessage( "ExtrapolationKind= " + vtcol.value("ExtrapolationKind") );
Application.LogMessage( "DefaultSegKind= " + vtcol.value("DefaultSegKind") );
Application.LogMessage( "LowClamp= " + vtcol.value("LowClamp") );
Application.LogMessage( "HighClamp= " + vtcol.value("HighClamp") );
|