v4.0
キャラクタ リギング
2ポイントスライドのセットアップ(2つのコントロールオブジェクトに2ポイントで拘束されたバインドのヌル。Make2PointSlideを参照)と、球形の太もものボリュームオブジェクトを作成します。これらに対して、バウンディングボリュームはバインドのヌルを拘束します。
MakeThighSlide に渡されるガイド
オブジェクトのコレクションによって、スライドの位置、および上腿のボリュームのプロポーションが決定します。
ガイド コレクションには 5 つのオブジェクトが含まれます。 はじめの 2 つのオブジェクトは最上部と最下部のコントロール
オブジェクトをスライドに配置するためのオブジェクトです。 バインド ポイントは、この 2
つのオブジェクトの中間になり、上腿のボリュームのセンターを決定します。 3
番目のオブジェクトは腰の最下部で、上腿のボリュームの半径を決定します。 4 番目と 5
番目のオブジェクトは大腿骨の基底部と先端(脚とひざのジョイント)です。 この 2
つのポイントによって作成されるベクトルが大腿骨を定義し、上腿のボリュームを大腿骨に位置合わせするために使用されます。
oThighSlide = MakeThighSlide( [Prefix], GuideObjectCollection, UpperParent, LowerParent ); |
ThighSlide JScript オブジェクトを戻します。
| パラメータ | タイプ | 詳細 | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Prefix | 文字列 | 新しく作成されたスライドのヌルの名前に付加するプリフィックス | ||||||||||||
| GuideObjectCollection | 文字列 | 上腿のスライドを作成する際に検索されるアイテムのリスト。 5 つ以上のアイテムが必要です。
|
||||||||||||
| UpperParent | 文字列 | 上腿のスライド アセンブリ上部の親オブジェクト、通常はヒップ | ||||||||||||
| LowerParent | 文字列 | 上腿のスライド アセンブリ下部の親オブジェクト、通常は大腿骨 |
/*
This example creates a thigh slide setup on a one bone chain.
MakeThighSlide needs a collection of five guide objects as an argument.
Build a collection of five guide nulls and position them.
*/
var guidecoll = new ActiveXObject("XSI.Collection");
guidecoll.Add( GetPrim("Null", "SlideTop") );
guidecoll.Add( GetPrim("Null", "SlideBottom") );
guidecoll.Add( GetPrim("Null", "SlideSideHip") );
guidecoll.Add( GetPrim("Null", "SlideThighLeg") );
guidecoll.Add( GetPrim("Null", "SlideThighKnee") );
//
// Make the slide control nulls red
//
MakeLocal(guidecoll(0)+".display", siDefaultPropagation);
SetValue( guidecoll(0)+".display.wirecol", 15, null);
MakeLocal(guidecoll(1)+".display", siDefaultPropagation);
SetValue( guidecoll(1)+".display.wirecol", 15, null);
//
// Position the guide objects
//
var lXfm = guidecoll(0).Kinematics.Global.Transform;
// slide control guides
lXfm.SetTranslationFromValues(-2,3,0);
guidecoll(0).Kinematics.Global.Transform = lXfm;
lXfm.SetTranslationFromValues(-1,-1,0);
guidecoll(1).Kinematics.Global.Transform = lXfm;
// hip bottom
lXfm.SetTranslationFromValues(-6,0,0);
guidecoll(2).Kinematics.Global.Transform = lXfm;
// thigh bone base and tip
var vThighBase = XSIMath.CreateVector3();
var vThighTip = XSIMath.CreateVector3();
vThighBase.Set(-3,3,0);
vThighTip.Set(-3.5,-4,0);
lXfm.SetTranslation(vThighBase);
guidecoll(3).Kinematics.Global.Transform = lXfm;
lXfm.SetTranslation(vThighTip);
guidecoll(4).Kinematics.Global.Transform = lXfm;
// Create a bone where the thigh bone is
var ThighChain = ActiveSceneRoot.Add2DChain(vThighBase, vThighTip);
var ThighSlide = MakeThighSlide("THIGH_", guidecoll, GetPrim("Null", "UpperParent"), ThighChain.Bones(0) );
logmessage ("Data in the returned thigh slide object:");
logmessage ("---------------------------------------");
logmessage ("Bind Null : " + ThighSlide.BindNull);
logmessage ("Top Null : " + ThighSlide.TopNull);
logmessage ("Base Null : " + ThighSlide.BaseNull);
logmessage ("Volume : " + ThighSlide.Volume);
//INFO : "Data in the returned thigh slide object:"
//INFO : "---------------------------------------"
//INFO : "Bind Null : THIGH_Bind"
//INFO : "Top Null : THIGH_Top"
//INFO : "Base Null : THIGH_Base"
//INFO : "Volume : THIGH_ThighVolume"
|