ノード変換プロパティ

特に記載しない限り、次に示す変換プロパティは、常に現在アクティブの コンテキスト式 で定義されている現在の作業座標系に変換されます。既定の coordsysworld です。ノードの posrotation、および scale プロパティは、ノードの変換コントローラに対応するサブコントローラへのエイリアスです。変換コントローラにこれらのサブコントローラの 1 つがない場合、対応するノード プロパティにアクセスすると、「未知のプロパティ」というエラー メッセージが返されます。たとえば、ルックアット コントローラには Rotation サブコントローラはなく、IK コントローラにはサブコントローラはありません。この場合でも、ノードの transform プロパティの Matrix3 プロパティを使用して、変換値にアクセスできます。たとえば、objpos=obj.transform.translationpart などのようにアクセスします。

<node>.transform: Matrix3

読み込み/書き込みアクセス。

書き込みアクセスの場合、Matrix 値は、位置、回転、スケールの各値に分解されます。これらの値は、位置、回転、スケールの各コントローラにそれぞれ保存されます(これらのコントローラが存在し、書き込み可能な場合)。

<node>.pos: Point3 --can use .position synonym throughout
<node>.pos.controller: Controller --can use .track synonym throughout
<node>.pos.isAnimated: Boolean, read-only --true if position is animated
<node>.pos.keys: MAXKeyArray
<node>.pos.track: Controller --synonym of .pos.controller
<node>.rotation: Quat

ワールド空間内のノードのトランスフォーム(シーンの原点を中心とする)の回転コンポーネントを Quat 値として取得または設定します。ノードのローカル空間内で回転するには、次のように実行します。

in coordsys (transmatrix $.pos) $.rotation = (quat 0 0 0.446743 0.894662)
<node>.rotation.x_rotation: Float --X rotation of node
<node>.rotation.y_rotation: Float --Y rotation of node
<node>.rotation.z_rotation: Float --Z rotation of node
<node>.rotation.controller: Controller --can use .track synonym throughout
<node>.rotation.isAnimated: Boolean, read-only --true if rotation is animated
<node>.rotation.keys: MAXKeyArray
<node>.rotation.track: Controller --synonym of .rotation.controller
<node>.scale: Point3 -- fraction
<node>.scale.controller: Controller --can use .track synonym throughout
<node>.scale.isAnimated: Boolean, read-only --true if scale is animated
<node>.scale.keys: MAXKeyArray
<node>.scale.track: Controller --synonym of .scale.controller
<node>.dir: Point3 --local z-axis direction vector

ノードの Z 軸が指定した方向に向くようにノードを回転します。ノードをノードの Z 軸を中心に回転し、Y 軸がワールド Z 軸の方向とできるだけ近くなるようにします。

<node>.dir を取得/設定すると、現在の座標系が重視されるようになりました。このプロパティは、以前は常にワールド座標内にありました。

<node>.max: Point3, read-only --max coordinates of node's bounding box
<node>.min: Point3, read-only --min coordinates of node's bounding box
<node>.center: Point3 --coordinates of center of node's bounding box
<node>.transform: Matrix3 --node's main transformation matrix
注:

3ds Max のユーザ インタフェースや MAXScript と異なり、内部の変換行列での回転が 左手規則であることに注意してください。このため、これらの行列から派生する回転を回転関連の関数に使われる回転や回転プロパティの回転と混用するときは注意してください。

<node>.pivot: Point3 -- node's pivot point position
<node>.objectOffsetPos: Point3
<node>.objectOffsetRot: Quat
<node>.objectOffsetScale: Point3

ワールド座標で、ノード ジオメトリの位置、回転、スケールの基点からのオフセットです。

<node>.objectTransform: Matrix3, read-only

ワールド座標におけるノード ジオメトリのオフセットです。

スクリプト:

    --Setting a node's rotation relative to world space without
    --messing with its position:
    fn setNodeWorldRotation theNode theRot =
    (
    in coordsys (transmatrix theNode.transform.pos)
    theNode.rotation = theRot
    )
    b = box isSelected:true
    setNodeWorldRotation $ (eulerangles 45 45 0)
    -- or: setNodeWorldRotation $ (quat 0 0 0.446743 0.894662)