The following properties and methods are applicable to any value that is derived from Node.
Quick Page Navigation - Jump To:
Node Viewport State Methods
Node Selection Methods
Modifier Stack Related Methods
Node Modifier Transform Methods
Node Conversion Methods
Node Utility Methods
Node User Properties
Inverse Kinematics Properties
identifies a unique node in the scene
n'th scene object in collection
The position and rotation values are relative to the current active grid if 'coordsys grid' is the current working coordinate system.
b = box name:"foo" position:[10,10,10] height:20
All of the node constructors can take the above optional keyword arguments, along with any of general node properties or any of the properties for the particular node class as keyword arguments.
The name keyword can be used to specify the name for the created node. 3ds Max allows the same name to be used for more than one node.
The prefix keyword can be used in place of the name keyword argument to specify the start of the node name from which 3ds Max will generate a unique name by adding a series of digits, as it does when creating objects interactively.
for i in 1 to 100 do sphere prefix:"baz"
--creates 100 spheres, giving each a unique name
--beginning with "baz", such as $baz01, $baz02, $baz03, etc.
The material keyword can be used to apply the specified material to the created node.
The target keyword can be used to automatically apply a LookAt controller to the node's transform track, and set the specified node as the LookAt target.
The transformation arguments, pos, scale, rotation, and pivot, are applied to the new object in the order they are specified in the constructor call, so you can control transform order. The pos, scale, and rotation arguments are mutually exclusive with the transform argument which can be used as an alternative way to set the node's complete transform matrix in one go.
Exercise care if you specify the target keyword. When you specify a target object, 3ds Max stores with the target object the last object it was assigned as a target of. If you delete the target object, the behavior of 3ds Max is to also delete the object looking at it. If the target object is a targetobject class object, deleting an object looking at it will also delete the target object, even if another object is also looking at it.
The performance of iterating and indexing the 'selection' and '$' object sets has been substantially improved in 3ds Max 4. In versions prior 3ds Max 4, the whole scene was traversed looking for selected nodes when indexing, iterating or snapshotting into an array, causing big delays in large scenes. Now, the 'selection' object set uses direct access to the SDK explicit current selection set.
See General Node Properties and Node Transform Properties for details about the properties accessible on scene nodes.
Most node methods are automatically mapped over node collections.
Returns true if is a node value, and the node has not been deleted. Otherwise, it returns false.
all the transform operations operate in the current working coordinate system. See Context Expressions.
All the clone operations can take any of the standard node creation optional keyword arguments which are applied after the node has been copied.
These functions clone all the original node's transform controllers and keys and the visibility controller and its keys if a visibility track has been assigned.
maxOps.cloneNodes is the preferred way to copy, instance, or reference nodes. Node interdependencies are retained, and more of the node properties are copied across.
function provides functionality similar to the SnapShot tool
Max. It generates a new node
that contains a copy of the world-state mesh of the source
The following example achieves an animation-based snapshot similar to the SnapShot tool in 3ds Max:
for t in 0 to 100 do at time t snapshot $foo
Deletes the specified node(s).
Lets you turn existing nodes into instances and references to other nodes. You can use these, for example, to replace the geometry of one node with another, perhaps for implementing custom level-of-detail tools.
It is possible to develop a custom scripted version of the File/Replace function with these functions and the mergeMAXFile() function by temporarily changing the name of a node in the current scene, merging in that named node from another, making the first node an instance of the newly merged node with instanceReplace(), deleting the newly merged node and renaming the old node back again.
Both these functions are collection mapped, so you can make a selection of objects all instance or reference the same object,
instanceReplace $foo* $baz
--makes all the foo* objects be instances of baz's geometry
--and modifier stack.
Returns the transform controller for the node.
Binds the scene node to the space warp object scene node. Space warp bindings show up in the modifier stack and can be accessed like any other modifier. Use the deleteModifier() function to unbind objects from space warps. See Modifier and SpacewarpModifier for more information about working with the modifier stack.
Returns a 2 element array containing the current number of faces for the node in the first element, and the current number of vertices for the node in the second element. The number of faces and vertices returned are the number that would be present if the node was converted to a mesh object.
Returns true if the node is a shape object, false otherwise
Returns the number of parametric surfaces in the object. At the current time, Loft objects are the only objects where more than one surface is present (ie. loft of a donut).
Returns a 2 element array indicating if the parametric surface is closed in the U and V dimensions (ie. a torus is closed in both U and V). Note that not all objects have this method implemented, and will return a default value of #(true, true).
Returns the transform axis
of the indexed axis system of the node as a
If the first argument is the value 'undefined' (instead of a node), the viewport common axis is returned instead. If the Coordinate System Center (getCoordCenter()) is #local or the Reference Coordinate System (getRefCoordSys()) is #local, #parent, or #gimbal, the last calculated common axis is returned.
The transform returned by this method can be used in an "in coordsys" context and an "about" context to move, rotate, or scale an object about the current 3ds Max UI Reference Coordinate System and Center.
fn axisRotate obj rotation =
local objA = if classof obj == objectSet or classof obj == array then obj else #(obj)
if getCoordCenter() != #local then
axis = getTransformAxis objA 0
for obj1 in objA do in coordsys axis about axis rotate obj1 rotation
for obj1 in objA do
axis = getTransformAxis obj1 0
in coordsys axis about axis rotate obj1 rotation
Invalidates the node's transformation matrix cache.
Invalidates the node's transformation matrix cache and notify the node's subtree that the transformation matrix has changed.
The following MAXScript function can be used to force an update of an object whose transform is partially controlled by a scripted controller (such as a script controller on the position track):
mapped fn TMInvalidate obj =
?(?at time (currenttime-1) obj.transform
Invalidates the node's world space cache.
Returns first node with the specified name. If exact is false (default), the normal MAXScript node name comparisons are performed.
ignoreCase specifies whether the comparisons should be case sensitive or not. When set to true, non-case-sensitive comparison will be performed.
If all is true, an array of nodes with the specified name is returned.
Default is exact:false ignoreCase:true all:false
When Fast Node Name Lookup is on, case sensitive comparisons are done first, case insensitive comparisons (if enabled) are done second, and then inexact matching (if enabled). If Fast Node Name Lookup is off, the first node found that matches the conditions is returned. So if you have 2 nodes called "AA" and "aa", and you say: 'getnodebyname "AA"', if Fast Node Name Lookup is on you will always get node AA back. If Fast Node Name Lookup is off, you can get either node back because both nodes match the conditions.
If you have a scene with 3 nodes: "AA", "aa", and "B B":
$Box:AA @ [...]
$Teapot:aa @ [...]
Sphere:B B @ [...]
getnodebyname "AA" exact:true
$Box:AA @ [...]
getnodebyname "AA" exact:false
$Box:AA @ [...]
getnodebyname "AA" ignoreCase:true
$Box:AA @ [...]
getnodebyname "AA" ignoreCase:false
$Box:AA @ [...]
getnodebyname "Aa" exact:true
$Box:AA @ [...]
getnodebyname "Aa" exact:false
$Box:AA @ [...]
getnodebyname "Aa" ignoreCase:true
$Box:AA @ [...]
getnodebyname "Aa" ignoreCase:false
getnodebyname "aa" exact:true
$Teapot:aa @ [...]
getnodebyname "aa" exact:false
$Teapot:aa @ [...]
getnodebyname "B B" exact:true
$Sphere:B B @ [...]
getnodebyname "B_B" exact:true
getnodebyname "BB" exact:true
getnodebyname "B_B" exact:false
$Sphere:B B @ [...]
getnodebyname "BB" exact:false
$Sphere:B B @ [...]
getnodebyname "AA" all:true
#($Teapot:aa @ [...], $Box:AA @ [...])
Returns world state of
node as a
and set the inheritance flags for the specified node as an
If keepPos:false is specified, the node may move when an inheritance is turned on or off.
and set the transform lock flags for the specified node as
Returns true if the node inherits the visibility of its parent object (if any), false if not.
whether the node inherits the visibility of its parent object (if
Returns an instance of the node's visibility controller. Returns undefined if the node does not have a visibility track.
Returns the node's Image Motion Blur Multiplier controller. Returns undefined if not Image Motion Blur Multiplier controller has been assigned to the node.
Sets the node's Image Motion Blur Multiplier value at the specified time to the specified value
Sets the node's Image Motion Blur Multiplier controller to the specified controller
which type of motion blur to use for node. If
whether the node is renderable. If
Returns the RenderID of the node. A value of 65535 is returned if the scene has not yet been rendered, or the node is not renderable. The RenderIDs of the nodes are output to the NODE_RENDER_ID g-buffer channel by the renderer.
Sets the RenderID of the node to the specified value. This value is not "sticky" - it is not saved with the scene, and it will be replaced by the renderer when the next render occurs.
Makes a group of the given nodes and returns the group node. You can optionally specify the group name or group name prefix. Not specifying a name or specifying a group name prefix ensures that the group name assigned is unique. Specifying select:true selects the group after it is made.
group $box* name:"boxes" --makes a group of all box*'s named "boxes".
group selection --groups current selection.
Ungroups one level of a group node.
ungroup $group01 --ungroups group $group01
Ungroups all levels in a group node.
Returns true if node is group head, false otherwise.
Returns true if node is in a group, false otherwise.
whether the group is set as open or closed. If
WARNING! Use the following methods with care. You can place nodes in states that are impossible to accomplish using the 3ds Max user interface.
whether the node is a group member or not. If
If you set a node to be a group member using this method, you need to set the node to be a child of a group head. Otherwise, the node name is not shown in the Select By Name dialog.
setGroupHead $dummy01 true
append $group03.children $dummy01
whether the node is flagged as a group head or not. If
If you flag a node as a group head using this method, the node's mesh will not be displayed in the viewports, and its properties will not be shown in the Modify panel. If you flag a group head node as not being a group head using this method, you will not be able to Open or Explode the group via the Group menu command.
-- create a set of spheres, group them, and test group head and member of group
mySpheres=for i=1 to 5 collect sphere pos:(random [-100,-100,0] [100,100,0])
group MySpheres name:"MyGroup"
isGroupHead $MyGroup -- returns true
isGroupMember $sphere01 -- returns true
--?check to see if group is open. Open group and test member of group
isOpenGroupHead $MyGroup -- returns false
setGroupOpen $MyGroup true
isOpenGroupMember $sphere01 -- returns false
-- create a new set of spheres, append the group to the set, and then group them all
NewSpheres=for i=1 to 3 collect sphere pos:(random [-100,-100,0] [100,100,0])
append NewSpheres $MyGroup
group NewSpheres name:"BiggerGroup"
--?open the group head, test member of group, and then close the groups.
setGroupOpen $BiggerGroup true
setGroupOpen $MyGroup false
setGroupOpen $BiggerGroup false
Hides the specified node or node collection.
Unhides the specified node or node collection.
If the optional doLayer keyword is set to true and the node is in a layer that is hidden, the entire layer is unhidden. When false (the default), just the node is unhidden.
Freezes the specified node or node collection.
Unfreezes the specified node or node collection.
If the optional doLayer keyword is set to true and the node is in a layer that is frozen, the entire layer is unfrozen. When false (the default), just the node is unfrozen.
Controls the disposition of scene nodes in the viewport foreground/background planes, so you can influence interactive performance on a node. Nodes placed in the foreground plane are redrawn individually and so interactive changes to them through spinners in scripted rollout panels are much faster.
The boolean argument puts the scene node(s) into the foreground plane if true, or into the background plane if false. You should be judicious in putting nodes in the foreground plane, because putting too many objects in the foreground plane reduces the foreground plane's effectiveness. Remember to unflag objects when you don't need to interactively control them any more.
Returns true if Trajectory is shown for the node, false otherwise.
whether Trajectory is shown for the node. If
Returns true if the node's showLinksOnly property is true.
Returns true if node is displayed using vertex colors in shaded viewports, false otherwise.
whether to display the effect of assigned vertex colors for the
node in shaded viewports. If
Returns true if the vertex color display for the node is shaded in the viewports, false otherwise.
Sets whether the vertex color display for the node is shaded in the viewports. When true, the colors are unshaded and appear in their pure RGB values. When false, the colors appear like any other assigned color in the viewports.
Deselects all currently selected scene nodes. Scene is redrawn unless redraw:false is specified.
Deselects the given node(s).
deselect $box* --deselects all items whose names start with "box".
Deselects a single node
Deselects any currently selected objects and then selects the node(s) you specified.
Adds the node(s) to the set of selected objects. If you want to build a set of selected objects from scratch in a loop, you can use clearSelection() to clear the selection before entering the loop, and use selectMore() in the loop to add objects to the set of selected objects.
whether a particular modifier or modifier class may be added the
The validModifier() method operates exactly as does the Modify panel in determining modifier applicability. Any modifier that takes a deformable object will return true for all scene objects except Helpers. This corresponds to the Modify panel's behavior of allowing modifiers such as Bend, Taper, etc. to be applied to lights and cameras, space warp objects, etc., as well as geometry types like box, sphere, etc., but not helpers such as dummys or bones.
method will return
Applies the modifier to all instances of the node(s) to which the function is applied. The optional before: keyword argument can be used to insert the modifier into the node's modifier stack just before the indexed modifier, counting from the top of the stack.
Since 3ds Max 3, addModifier() does not preserve the sub-object selection that might be active in the modifier stack when adding the modifier. If you want to add a modifier and preserve the sub-object selection, use the modPanel.addModToSelection() method described in Modify Panel.
Also see Modifier and SpacewarpModifier for more details.
you delete modifiers from the modifier stack. Takes either a
modifier value which is present on the
Collapses the modifiers out of a stack, leaving a resultant editable base object corresponding to the class of the node(s) on top of their stack. If there are no modifiers in the stack when this is called, no action is taken. If you want to force an object to be an editable mesh, use the function convertToMesh().
Returns a Matrix3 value giving the modifier's context transform for the local coordinates used in modifier sub-object gizmos. Accessing the transform properties of a modifier sub-object such as a gizmo or a center in MAXScript yields values that are relative to that modifier's context transform, equivalent to the values shown in track view for those properties. If the modifier is not operating on a sub-object selection, such as a face or vertex selection, or if the modifier was interactively applied to an object selection, this context TM is the local coordinate space of the object itself. However, if the modifier is operating on either an object selection set or a sub-object selection, the context transform gives the position and orientation of that selection, and so you can use the getModContextTM() function to get the world-space transform properties of any of its sub-objects.
These functions complement the getModContextTM() function and can be used to derive the world-space coordinates of the bounding box of the modifier context. This can be used, for example, to determine the bounds of a modifier operating on a sub-selection or the bounds of an FFD lattice. This is particularly useful for scripting FFD control point placement, since these control points live in a 0-to-1 lattice space—the mod context bounding box gives the world space bounds of this lattice space allowing you to compute scaled lattice space coordinates from world coordinates. The functions return Point3 values for the minimum and maximum extents of the bounding box.
See Modifier Sub-Object Transform Properties for examples of using the above methods.
This function converts appropriate scene object types into Editable Meshes. It is similar to collapseStack() in that it will remove all modifiers present, but unlike collapseStack() it will always replace the base object with an editable mesh version, even if there are no modifiers present.
convertToMesh() can be applied to any object that an Edit Mesh modifier can work on, such as geometry and shapes, but not helpers, space warps, lights, etc. If the object cannot be converted, the function returns undefined.
Converts the given scene node to a SplineShape object. If the object cannot be converted (typically, if it is not a shape), the function returns undefined. Any modifiers present will be collapsed. The collapseStack() function can also be used as can the collapse button in the modifier stack dialog in 3ds Max; both generate a SplineShape, but will only do so if there is at least one modifier present.
Allows you to test whether a given node is convertible into a given class. Returns true or false.
if canConvertTo $foo NURBSSurface then ...
The kinds of classes you can convert objects to are the generic editable forms including Mesh, SplineShape, NURBSCurve, NURBSSurface, etc.
This function is a general form of the existing specific conversion functions such as convertToMesh(), convertToSplineShape(), etc.
convertToSplineShape() can be written:
convertTo $circle01 SplineShape
If the conversion is not supported, the function returns the value undefined.
These functions work on those primitive geometry and shape classes that support conversion to NURBS (such as boxes, spheres, circles, lines, etc.). If an object does not support conversion, the function returns undefined.
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.
sel = selection as array -- snapshot selection
--?by the user or other scripts>
for obj in sel
where not isDeleted obj do
move obj [10,0,0]
When a node has been deleted,
if mynode != undefined and not isdeleted myNode do ...
Computes the distance between the pivot points of the two specified nodes.
Computes the closest intersection of the ray and the surface of the given node. Returns another Ray which defines the position of intersection in 3D space and the surface normal direction vector at that point. The intersection test respects the face normals of the node, i.e. if a face's normal points away from the ray's source, an intersection test is not performed on that face. intersectRay() works if the world state of the node (the state of the node at the top of the node's stack) has a surface, such as an editable mesh, a Standard, Extended, or Compound Primitive, or a Patch or NURBS surface object. Splines and NURBS curves do not have a surface. Returns undefined if the ray doesn't intersect the node, the faces it does intersect point away from the ray's position, or the node does not have a surface.
Takes a ray and computes the closest intersection to the surface of the given node. It returns an array with the following three elements.
A Ray defining the position of intersection in 3-space and the surface normal direction vector at the point.
The index of the face the ray intersects with
The barycentric coordinates of the face that was hit.
This method only works if the world state of the node is a mesh, either because it started as an editable mesh or because it has modifiers applied that convert the node to a mesh. Unlike intersectRay(), this method will not work if the node is a Standard or Extended Primitive - the node's stack must evaluate to a mesh. The intersection test respects the face normals of the node, i.e. if a face's normal points away from the ray's source, an intersection test is not performed on that face. Returns undefined if the ray doesn't intersect the node, the faces it does intersect point away from the ray's position, or the node isn't a mesh.
What are Barycentric Coordinates?
Barycentric coordinates are the coordinates relative to the triangular face. The barycentric coordinates of a point p relative to a triangle describe that point as a weighted sum of the vertices of the triangle.
If the barycentric coordinates are b0, b1, and b2, then:
p = b0*p0 + b1*p1 + b2*p2;
where p0, p1, and p2 are the positions of the vertices of the triangle. The Point3 returned by this method has the barycentric coordinate stored in its three component values. The coordinate is relative to the triangular face that was intersected. Barycentric coordinates can also be used to interpolate any quantity whose value is known at the vertices of the triangle.
Following is an example of finding the UV coordinates at the intersection point:
s = sphere material:(standardMaterial diffuseMap:(checker()))
showTextureMap s.material s.material.diffuseMap on
--?Add a normal modifier to make the sphere into a mesh
addModifier s (normalModifier())
r = ray [-100,5,0] (s.center-[-100,5,0])
--?Get the Intersection details
arr = (intersectRayEx s r)
--?Create a dummy at the point of intersection
--?Get the texture face
tf = getTVFace s arr
--?Get the UVW verts of the face
tv1 = getTVert s tf.x
tv2 = getTVert s tf.y
tv3 = getTVert s tf.z
--?Calculate the texture vertices at point of intersection from
--?the barycentric coordinates
tv = tv1*arr.x + tv2*arr.y + tv3*arr.z
--?Delete the modifier
deleteModifier s 1
Returns true if the bounding boxes of the two specified nodes overlap, or false if they do not overlap.
Prints a representation of the current modifier stack for the given node.
node's user property with
the given key as a string.
Sets the node's user property with the given key to the given value.
Retrieves the entire user property buffer as a string containing all the user property settings. This is effectively the contents of the User Defined Properties box in the 3ds Max Object Properties dialog.
Sets the user property buffer to the given string.
See Node User-Defined Properties and Methods for more information on these methods.
The following methods get and set the node's IK values as seen in the Hierarchy panel, Object Parameters rollout.
Returns the rotation binding weight for the node.
Sets the rotation binding weight for the node.
Returns the position binding weight for the node.
Sets the position binding weight for the node.
indicate if the specified axis is turned on for position or
rotation binding. If an axis is turned off, the specified axis is
no longer influenced by the follow object or the IK Controller
Position end effector.
Sets the axis state for position or rotation binding to the specified boolean value. See getTaskAxisState() for a description of the parameters.
Mirrors the specified IK
constraints on the specified node's transform
controller about the specified axis.
Call this method when one of the node level IK parameters has been changed.
Returns the class of the
world state of the node (the state of the node at the top of its
stack). If no modifiers are applied to the base object, the class
returned is the class of the base object. If modifiers are applied
to the base object, the class returned is the class of the node as
it exits the last modifier. For example, if you apply a Bend
modifier to a Box, the Bend modifier converts the incoming Box
primitive to a mesh, and the class returned by
Editable_Mesh. You can get the class of the base object in all
cases by using classOf
Returns true if the specified point is selected, false if not. The definition of a 'point' varies depending on the object type. For meshes, it is the mesh vertex. For a spline, it is the knot. For NURBS objects, it is the vertex or control point.
Returns a floating point weighted point selection if the object supports soft selections. Most object types just return 1.0 if the point is selected and 0.0 if not. Only NURBS and Editable Mesh objects currently support weighted point selection.
Invalidates the rectangle in the viewports that the node is occupying. Rectangles flagged as invalid will be update on the next screen redraw.
This method stops the creation of the current object, if any. This method is primarily used to ensure that a NURBS objects is fully created, which it until the creation is stopped. This method will also deactivated any activated object create buttons in the Create panel.
Generates a unique scene node name from a prefix string by adding a series of digits, in the same manner the 3ds Max does as you create objects in the scene. This name is only guaranteed to be unique until the next scene node creation.
$foo.name = uniqueName "foo"
MAXWrapper Common Properties, Operators, and Methods
Value Common Properties, Operators, and Methods
General Node Properties
Node Transform Properties
Node User-Defined Properties and Methods
Nested Object Properties
Class and Object Inspector Functions
NURBS Node Properties and Methods