PathName Values

Value >Collections > Collection Types > PathName Values

 

   

Values and Collections - Quick Navigation

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 the center of the bounding box of all objects in pathname.

   

<pathname>.max : Point3, read-only

Returns the maximum corner of the bounding box.

   

<pathname>.min : Point3, read-only

Returns the minimum corner of the bounding box.

   

<pathname>.count : Integer, read-only

Returns the number of objects in set. This property is only valid for wild-carded pathnames (a pathname that can contain more than one scene object).

   

Operators

<pathname>[<integer>]

Accesses the member of collection. Indexes start at 1.

   

<pathname> as array

Converts the pathname collection to an array

   

Associated Methods

isDeleted <MAXWrapper_object>

This function yields the result as 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.

Otherwise, performing an operation on a deleted 3ds Max object referenced in a variable or array generates an exception.

Any kind of 3ds Max object can be tested in this way such as, scene objects, modifiers, controllers, materials, and others.

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
move 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 can do this with a <level_expr> , one of the many context expressions that are described in Context Expressions.

EXAMPLES:

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
)

See Also