現在のローカル変換の一部または全部をニュートラル ポーズ変換にコピーします。 また、新しいニュートラル ポーズに基づいてローカル変換を再計算します。 ニュートラル ポーズは、オブジェクトとその実際の親の中間ペアレントのような働きがあります。 ニュートラル ポーズの変換値は、親オブジェクトに対して相対的な値となります。
オブジェクトのニュートラル ポーズは、ローカル変換が識別されるポーズです。 Softimage では、オブジェクトの親のポーズがデフォルト ニュートラル ポーズとなります。 ローカル アニメーションは、オブジェクトのニュートラル ポーズに対して相対的なアニメーションとなります。
オブジェクトをニュートラルポーズにリセットするには、ResetTransformを使用します。
SetNeutralPose( [InputObjs], [Type], [Reset] ); |
| パラメータ | タイプ | 説明 |
|---|---|---|
| InputObjs | 文字列 |
オブジェクトまたはコンポーネントのリスト。 デフォルト値: 選択されているエレメント |
| Type | siTransformFilter |
リセットする変換のタイプを指定します。 デフォルト値: siSRT |
| Reset | Boolean |
False = ニュートラル ポーズを設定、True = ニュートラル ポーズをリセット デフォルト値: False |
//
// This script creates a cone, sets a pose, copies the local transform
// into the neutral pose (which will zero-out the local transform), then
// resets the neutral pose (which will restore the local transform).
//
var oMyCone = CreatePrim("Cone", "MeshSurface")
Translate(oMyCone, 1,2,3,siRelative, siView, siObj, siXYZ, null, null, null, null, null, null, null, null, null);
Rotate(oMyCone, 10, 20, 30, siRelative, siLocal, siObj, siXYZ, null, null, null, null, null, null, null);
LogMessage("Original");
LogPosAndRot(oMyCone);
//set the current pose as the neutral pose
SetNeutralPose(oMyCone, siSRT, false);
LogMessage("After setting neutral pose");
LogPosAndRot(oMyCone);
//reset the neutral pose
SetNeutralPose(oMyCone, siSRT, true);
LogMessage("After resetting neutral pose");
LogPosAndRot(oMyCone);
//--------------------------------------------//
// log the local position and rotation, //
// and the neutral pose position and rotation //
//--------------------------------------------//
function LogPosAndRot( in_obj )
{
LogMessage("Local Position:" +
" (" + GetValue(in_obj+ ".kine.local.posx") +
" ," + GetValue(in_obj+ ".kine.local.posy") +
" ," + GetValue(in_obj+ ".kine.local.posz") + ")");
LogMessage("Local Rotation:" +
" (" + GetValue(in_obj+ ".kine.local.rotx") +
" ," + GetValue(in_obj+ ".kine.local.roty") +
" ," + GetValue(in_obj+ ".kine.local.rotz") + ")");
LogMessage("Neutral Position:" +
" (" + GetValue(in_obj+ ".kine.local.nposx") +
" ," + GetValue(in_obj+ ".kine.local.nposy") +
" ," + GetValue(in_obj+ ".kine.local.nposz") + ")");
LogMessage("Neutral Rotation:" +
" (" + GetValue(in_obj+ ".kine.local.nrotx") +
" ," + GetValue(in_obj+ ".kine.local.nroty") +
" ," + GetValue(in_obj+ ".kine.local.nrotz") + ")");
LogMessage ("--------------------------");
}
//
// Output from this script:
//
//INFO : "Original"
//INFO : "Local Position: (1 ,2 ,3)"
//INFO : "Local Rotation: (10 ,20 ,30)"
//INFO : "Neutral Position: (0 ,0 ,0)"
//INFO : "Neutral Rotation: (0 ,0 ,0)"
//INFO : "--------------------------"
//INFO : "After setting neutral pose"
//INFO : "Local Position: (0 ,0 ,0)"
//INFO : "Local Rotation: (0 ,0 ,0)"
//INFO : "Neutral Position: (1 ,2 ,3)"
//INFO : "Neutral Rotation: (10 ,20 ,30)"
//INFO : "--------------------------"
//INFO : "After resetting neutral pose"
//INFO : "Local Position: (1 ,2 ,3)"
//INFO : "Local Rotation: (10 ,20 ,30)"
//INFO : "Neutral Position: (0 ,0 ,0)"
//INFO : "Neutral Rotation: (0 ,0 ,0)"
//INFO : "--------------------------" |