PathName Values

PathNames provide the mechanism for naming objects in the 3ds max scene. See also Pathname Literals. Pathname values are mappable.

Example Literals

$box01

$torso/left_upper_arm/left_lower_arm

$*box*

$torso/*

$torso...*

Properties

<pathname>.center       : Point3, read-only

Returns center of bounding box of all objects in pathname.

<pathname>.max          : Point3, read-only

Returns maximum corner of bounding box.

<pathname>.min          : Point3, read-only

Returns minimum corner of bounding box.

<pathname>.count        : Integer, read-only

Returns number of objects in set. This property is only valid for wild-carded pathnames, i.e., a pathname that could contain more than one scene object.

Operators

<pathname>[<integer>]    -- accesses member of collection. Indexes start at 1.

<pathname> as array      -- converts pathname collection to an array

Associated Methods

isDeleted <MAXWrapper_object>

This function yields the result true if the object has been deleted and false if it still exists in the scene. Using the function only makes sense in situations where references to 3ds max objects are held in variables or arrays or passed as parameters and you want to determine whether the object has been deleted from the scene. Performing an operation on a deleted 3ds max object referenced in a variable or array otherwise generates an exception. Any kind of 3ds max object can be tested in this way, scene objects, modifiers, controllers, materials, etc.

Example:

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

obj [10,0,0]

Note: The order of sequencing is consistent in a stable scene but somewhat arbitrary - it depends on how 3ds max stores its object hierarchy internally which is affected mostly by order of additions and deletions to and from the scene.

MAXScript lets you set up a 'working level' in the 3ds max scene hierarchy that affects pathnames and coordinate systems and object creation. You do this with a <level_expr>, one of the many context expressions that are described in Context Expressions.

Examples

a = $*feet*[i] -- retrieves the i'th 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.

$foo.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

)