キャラクタ開発キット(CDK)は、特別な JScript オブジェクトを返す、Softimage スクリプト コマンドのセットです。 各オブジェクトは、プロパティを使って、さまざまなコンポーネントや関連するシーン オブジェクトへのアクセスを提供します。 たとえば以下のようになります。
// Set up the guide collection containing the shoulder, elbow and hand
var guidecoll = new ActiveXObject("XSI.Collection");
guidecoll.Add( GetPrim("Null", "ShoulderGuide") );
guidecoll.Add( GetPrim("Null", "ElbowGuide") );
guidecoll.Add( GetPrim("Null", "HandGuide") );
var lXfm = guidecoll(0).Kinematics.Global.Transform
lXfm.SetTranslationFromValues( 0, 0, 0 );
guidecoll(0).Kinematics.Global.Transform = lXfm;
lXfm.SetTranslationFromValues( 4, 0, -2 );
guidecoll(1).Kinematics.Global.Transform = lXfm;
lXfm.SetTranslationFromValues( 8, 0, 0 );
guidecoll(2).Kinematics.Global.Transform = lXfm;
// Create the arm, getting the pointer to it from the command
var RArmParent = GetPrim( "Null", "RArmParent" );
var RArm = MakeArm( RArmParent, guidecoll, "R", null, 0, 0, 0, null, null, 0 );
// Among other things, the custom Arm object gives you access to the parent of
// the UpVector, a Skeleton collection of arm chain elements, the Bicep roll
Application.LogMessage( "UpVector parent: " + RArm.UpVParent.Name );
var eSkel = new Enumerator( RArm.Skel );
Application.LogMessage( "Skeleton collection contains: " );
for ( ; !eSkel.atEnd(); eSkel.moveNext() ) {
Application.LogMessage( "\t" + eSkel.item().Name );
}
Application.LogMessage( "BicepRoll: " + RArm.UpV.Name );
// Output:
// INFO : UpVector parent: RRoot
// INFO : Skeleton collection contains:
// INFO : RRoot
// INFO : RBicep
// INFO : RForearm
// INFO : RArmEff
// INFO : BicepRoll: RArmUpVこのセクションでは、次の CDK オブジェクトのリファレンスを示します。