MakeJointCompression

導入

v4.0

カテゴリ

キャラクタ リギング

詳細

ジョイント圧縮は、互いに押し合う 2 つのキャラクタのパーツをモデル化するためのテクニックで、通常腕や脚に使用します。 LowerBone のプッシュには球のバウンディング ボリュームが使用され、押される側の UpperBone には 2 つのヌルが使用されます。 たとえば、前腕が上腕を押すと、前腕に押されることによって上腕はわずかに変形します。 バウンディング ボリュームは前腕にアタッチされ、上腕のヌルによってよりリアルなスキンのデフォーメーションが実現されます。

スクリプト構文

oJoint = MakeJointCompression( [Prefix], UpperBone, LowerBone, GuideObjectCollection, [RollDivisionCollection] );

戻り値

Joint JScript オブジェクトを戻します。

パラメータ

パラメータ タイプ 詳細
Prefix 文字列 新しく作成された圧縮のヌルの名前に付加するプリフィックス。
UpperBone 文字列 ジョイント アセンブリの上部の親。
LowerBone 文字列 ジョイント アセンブリの下部の親。
GuideObjectCollection 文字列 次の 4 つのオブジェクトのリストです。1)ルートに一番近い、上部ジョイントのラインを定義するボックス、2) ジョイントに一番近い、上部ジョイントのラインを定義するボックス、3) 下部ジョイントの旋回カーブの中間にある、ボックスコントロール、4) 旋回のカーブのセンター位置として動作する小さな球。
RollDivisionCollection 文字列 このアセンブリを、ボーンではなく、回転分割にバインドするための回転分割オブジェクトのコレクション(オプション)。

JScript の例

/*
        This script makes a 2 bone arm
        and attaches joint compression nulls
        to the bicep.
*/
//
// Draw an arm-like two bone chain
//
var lPosStart = XSIMath.CreateVector3();
var lPosEnd = XSIMath.CreateVector3();
lPosStart.Set(0,0,0);
lPosEnd.Set(3,0,-1);
var HandChain = ActiveSceneRoot.Add2DChain(lPosStart, lPosEnd);
lPosEnd.Set(6,0,0);
HandChain.AddBone(lPosEnd, 2);
//
// Create guide objects and position them
//
var guidecoll = new ActiveXObject("XSI.Collection");
guidecoll.Add( GetPrim("Null", "RootGuide") ); 
guidecoll.Add( GetPrim("Null", "JointGuide") ); 
guidecoll.Add( GetPrim("Null", "SphereCenter") ); 
guidecoll.Add( GetPrim("Null", "RadiusControl") ); 
var Xfm = XSIMath.CreateTransform();
Xfm.SetTranslationFromValues(2,0,0.5);
guidecoll(0).Kinematics.Global.Transform = Xfm;
Xfm.SetTranslationFromValues(2.5,0,0.5);
guidecoll(1).Kinematics.Global.Transform = Xfm;
Xfm.SetTranslationFromValues(2,0,-1);
guidecoll(2).Kinematics.Global.Transform = Xfm;
Xfm.SetTranslationFromValues(4,0,-1);
guidecoll(3).Kinematics.Global.Transform = Xfm;
var JointCmp = MakeJointCompression("ABC_",HandChain.Bones(0),HandChain.Bones(1),guidecoll);
logmessage ("Data in the returned joint compression object:");
logmessage ("---------------------------------------------");
logmessage ("UpperJoint: " + JointCmp.UpperJoint);
logmessage ("LowerJoint: " + JointCmp.LowerJoint);
logmessage ("Volume    : " + JointCmp.Volume);
logmessage ("Envelope  : " + JointCmp.Envelope);
//results of running this script: 
//INFO : "Data in the returned joint compression object:"
//INFO : "---------------------------------------------"
//INFO : "UpperJoint: ABC_UpperJoint"
//INFO : "LowerJoint: ABC_LowerJoint"
//INFO : "Volume    : ABC_BendVolume"
//INFO : "Envelope  : ABC_UpperJoint,ABC_LowerJoint"

関連項目

MakeArm MakeLeg