Value > Collections > Collection Types > ObjectSet Values |
ObjectSets represent the main scene object categories in 3ds Max. The "constructors" below are all reserved system variables. ObjectSet values are mappable.
objects --all the objects geometry --the standard 3ds Max categories... lights cameras helpers shapes systems spacewarps selection --the current selection
Returns center of bounding box of all objects in set.
Returns maximum corner of bounding box.
Returns minimum corner of bounding box.
Returns number of objects in set.
Accesses member of collection. Indexes start at 1.
Converts objectset collection to an array.
Clears current scene node selection.
Deselects any current selection first, then selects the specified nodes.
Adds the specified node(s) to the current selection.
Returns the current selection as an array. This is similar to selection as array, however selection as array returns a copy of the selection.
ObjectSets are actually special types of value that denote their sets, stored in reserved system variables of the same name, so you can assign them to other variables and pass them around as function arguments, etc.
When storing an ObjectSet in a variable, the ObjectSet value is stored rather than the objects in the ObjectSet. Thus, if the scene changes and the ObjectSet is affected by this change, the value assigned to the variable will also change dynamically to reflect the scene changes.
To store a snapshot of the objects currently in the ObjectSet to a variable, first convert the ObjectSet to an array using the as operator.
You can use ObjectSets as the root of a pathname,
which limits the pathname searching to the object set you've specified. So, in the above example, it will name only helper objects that start with 'd'.
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 effected mostly by order of additions and deletions to and from the scene.
The lights and cameras object sets include the target objects, if any, for the lights and cameras. If you want to change a property value for all the lights or cameras, you will need process each object in the ObjectSet individually, testing to make sure it is a light or camera.