v4.0
アップベクター コントロール オブジェクトによって、2 ボーンの脚を作成します。脚のボーンは股関節、ひざのジョイント、足首のガイド オブジェクトのコレクションによって作成されます。
MakeLeg コマンドでは、必要に応じて大腿に回転分割を追加することができます。 回転分割は、隣接するボーンとの回転の差異をボーンの長さ全体に分散させるために使用します。 エンベロープのデフォーマとして使用すると、ボーンの長さ全体に均等にツイストを分散し、より自然なスキンのデフォーメーションを実現できます。 回転分割は、MakeBicepRollコマンドを使用して、別途追加することもできます。
必要に応じて、脚にシャドウ リグをアタッチすることができます。 シャドウ オブジェクトは脚の各チェイン エレメントに対して作成され、シャドウ ボーンは実際の脚のボーンにポーズで拘束されます。 シャドウ リグはリグのアニメーションをプロットする際に使用できます。
oLeg = MakeLeg( Model, Parent, [Prefix], GuideObjectCollection, [UpVectorBehindLeg], [NbThighDivisions], [ShadowType], [ShadowParent] ); |
Leg JScript オブジェクトを戻します。
| パラメータ | タイプ | 説明 | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Model | 文字列 | 脚が所属するモデル。 | ||||||||||||
| Parent | 文字列 | 新しい脚の親。 | ||||||||||||
| Prefix | 文字列 | 新しく作成された脚オブジェクトの名前に付加するプリフィックス。 | ||||||||||||
| GuideObjectCollection | 文字列 | 脚を作成する際に検索される 3 つのオブジェクトのリスト:1)脚の最上部、2)膝のジョイント、3)足首 | ||||||||||||
| UpVectorBehindLeg | Boolean |
アップベクターを脚の背後に配置(グローバルの -z)するか、前面に配置(グローバルの +z)するかを指定します。 デフォルト値: False |
||||||||||||
| NbThighDivisions | Integer |
回転分割の数。 値がゼロの場合には、回転は作成されません。 デフォルト値: 3 |
||||||||||||
| ShadowType | Integer |
脚にアタッチするシャドウ リグのタイプ。 シャドウ リグは、アニメーションを転送または再マップするために使用します。 デフォルト値: 0
|
||||||||||||
| ShadowParent | 文字列 | シャドウ リグ階層の親。 空の場合には、シャドウ リグは作成されません。 |
/*
This script creates two legs, left and right
Left leg has thigh roll divisions
Right leg has a box shadow hierarchy
*/
var guidecoll = new ActiveXObject("XSI.Collection");
guidecoll.Add( GetPrim("Null", "Guide_HipJoint") );
guidecoll.Add( GetPrim("Null", "Guide_KneeJoint") );
guidecoll.Add( GetPrim("Null", "Guide_AnkleJoint") );
var lXfm = guidecoll(0).Kinematics.Global.Transform
var lNull = GetPrim("Null", "Legs");
/*
Right Leg
*/
lXfm.SetTranslationFromValues(2,4,0);
guidecoll(0).Kinematics.Global.Transform = lXfm;
lXfm.SetTranslationFromValues(2,0,-1);
guidecoll(1).Kinematics.Global.Transform = lXfm;
lXfm.SetTranslationFromValues(2,-4,0);
guidecoll(2).Kinematics.Global.Transform = lXfm;
var RLeg= MakeLeg(lNull, GetPrim("Null", "RLegParent"),"R", guidecoll, true, 0, 4, GetPrim("Null", "RShadowParent") );
Logmessage("Right Leg");
DumpLeg(RLeg);
/*
Left Leg
*/
lXfm.SetTranslationFromValues(-2,4,0);
guidecoll(0).Kinematics.Global.Transform = lXfm;
lXfm.SetTranslationFromValues(-2,0,-1);
guidecoll(1).Kinematics.Global.Transform = lXfm;
lXfm.SetTranslationFromValues(-2,-4,0);
guidecoll(2).Kinematics.Global.Transform = lXfm;
var LLeg = MakeLeg(lNull , GetPrim("Null", "LLegParent"),"L", guidecoll);
Logmessage("Left Leg");
DumpLeg(LLeg);
function DumpLeg(inLeg)
{
logmessage ("Data in the returned leg:");
logmessage ("------------------------");
logmessage ("Root : " + inLeg.Root);
logmessage ("Effector : " + inLeg.Eff);
logmessage ("UpVector : " + inLeg.upV);
logmessage ("Skeleton : " + inLeg.Skel);
if(inLeg.ThighDivisions>0)
{logmessage ("Thigh Divs : " + inLeg.ThighRoll.Divisions);}
logmessage ("Hidden : " + inLeg.Hidden);
logmessage ("Envelope : " + inLeg.Envelope);
logmessage ("ShadowsStart: " + inLeg.ShadowStart);
logmessage ("ShadowsEnds : " + inLeg.ShadowEnds);
logmessage ("Shadows : " + inLeg.Shadows);
}
//results of running this command:
//INFO : Right Leg
//INFO : Data in the returned leg:
//INFO : ------------------------
//INFO : Root : RRoot
//INFO : Effector : RlegEff
//INFO : UpVector : RlegUpV
//INFO : Skeleton : RRoot,RThigh,RShin,RlegEff
//INFO : Hidden : RRoot,RlegEff
//INFO : Envelope : RThigh,RShin
//INFO : ShadowsStart: RThigh1
//INFO : ShadowsEnds : RForeleg
//INFO : Shadows : RThigh1,RForeleg
//
//INFO : Left Leg
//INFO : Data in the returned leg:
//INFO : ------------------------
//INFO : Root : LRoot
//INFO : Effector : LlegEff
//INFO : UpVector : LlegUpV
//INFO : Skeleton : LRoot,LThigh,LShin,LlegEff
//INFO : Thigh Divs : LBicepRoll1,LBicepRoll2,LBicepRoll3,LBicepRoll_4
//INFO : Hidden : LRoot,LlegEff
//INFO : Envelope : LShin,LBicepRoll1,LBicepRoll2,LBicepRoll3,LBicepRoll_4
//INFO : ShadowsStart: undefined
//INFO : ShadowsEnds : undefined
//INFO : Shadows : undefined |