値 > コレクション > コレクションのタイプ > PathName 値 |
PathNames は、3ds Max シーン内のオブジェクトに名前を付ける機能を提供します。「パス名リテラル」も参照してください。パス名値はマップ可能です。
リテラルの例
$box01 $torso/left_upper_arm/left_lower_arm $*box* $torso/* $torso...*
プロパティ
<pathname>.center : Point3, read-only
パス名内のすべてのオブジェクトのバウンディング ボックスの中心を返します。
<pathname>.max : Point3, read-only
バウンディング ボックスの最大コーナーを返します。
<pathname>.min : Point3, read-only
バウンディング ボックスの最小コーナーを返します。
<pathname>.count : Integer, read-only
セット内のオブジェクトの数を返します。このプロパティは、ワイルドカード付きのパス名(複数のシーン オブジェクトを含むパス名)に限り有効です。
演算子
<pathname>[<integer>]
コレクションのメンバにアクセスします。インデックスは 1 から始まります。
<pathname> as array
パス名のコレクションを配列に変換します。
関連するメソッド
isDeleted <MAXWrapper_object>
オブジェクトが既に削除されている場合、この関数は true を返し、オブジェクトがまだシーン内に存在している場合は、 false を返します。
この関数の使用は、3ds Max オブジェクトへの参照が変数や配列内に保持される場合や、パラメータとして渡され、オブジェクトがシーンから削除されているかどうかを判断したい状況でのみ役立ちます。
変数や配列で参照された削除済みの 3ds Max オブジェクトで演算が実行されると、他の方法で例外が発生します。
シーン オブジェクト、モディファイヤ、コントローラ、マテリアルなど、どの種類の 3ds Max オブジェクトもこの方法でテストすることができます。
例: |
myBoxes = $box* as array -- store list of all boxes in array myBoxes --... -- <one or more objects in the selection are deleted -- by the user or other scripts> --... for obj in myBoxes where not isDeleted obj do move obj [10,0,0] |
MAXScript では、パス名、座標系、およびオブジェクトの作成に影響する 3ds Max シーン内の「作業レベル」を設定できます。これは、 <level_expr> (多くのコンテキスト式の 1 つ)を使っています。コンテキスト式の詳細は、「コンテキスト式」を参照してください。
例: |
b = box name: "foo" isSelected:true s = sphere name: "feet" a = $*feet*[1] -- retrieves the first object in the *feet*'s -- tell me what things inside dummy have a non-identity scale for obj in $dummy...* where obj.scale != [1,1,1] do format "% has non-identity scale: %\n" obj.name obj.scale -- place $foo's pivot point at the max corner of the set of 'box*' objects. b.pivot = $box*.max in $dummy ( sphere name:"ear1" pos:[10,10,10] -- create as children of $dummy sphere name:"ear2" pos:[-10,10,10] scale $foo/* [1,1,2] -- looks for 'foo' as a child of $dummy ) |