View Full Version : The age-old question: node vs. object

02-23-2012, 10:15 AM
Hi all,

Does anyone know what is the distinction between a node and an object in maxscript? By object I mean a scene object and not the programming object, of course.


02-23-2012, 04:58 PM
Node is an object in the viewport and an object can be modifiers, controllers, ca defs or nodeTransformMonitors and the like.

What is it that you are trying to do?

02-23-2012, 07:43 PM
Hi all,


In the documentation, the two are often used to denote the same thing - "scene node" and "scene object" are considered the same.

From Class point of view though, Node is the component that holds the scene data of the scene object, including the Transforms track, the Visiblity, Cast Shadows, Wirecolor, Material and all other properties seen in the "Object Properties" dialog. So the Node is actually just a part of the scene object, but since you cannot have a scene object without a node, and you cannot have a node that does not define a scene object, they are used interchangeably.

The Node Class Instance is always unique, even if the scene object itself is cloned as an instance. You can see what MAXScript calls a "Node" in the TrackView as the top-level track of a scene object just below the "Objects" track. In other words, a Teapot is a "scene node" or "scene object", but consists of a Node class instance describing the unique appearance and location in world space of the scene node, with a Modified Object plugged into it, with a Base Object plugged into that. I guess it was called a Node because it is the Root of a scene object in the Scene Tree.

The class hierarchy of a Teapot looks like

classof $ --> Teapot
superclassof $ --> GeometryClass
classof (superclassof $) --> Node

But keep in mind that the classof reflects the base and modified objects, the superclassof also, and the Node instance they are plugged in does not care - if you plug in a Light base object into a Teapot's base object, you will get a Light! So a scene node is hosted by a Node class instance and while all scene objects derive from Node, the Node itself appears to be changing depending on what is connected to it, but is actually always the same unchanging thing that transforms the object in world space and controls its look...

t = Teapot() --> $Teapot:Teapot002 @ [0.000000,0.000000,0.000000]
classof t --> Teapot
superclassof t --> GeometryClass
classof (superclassof t) --> node
t.baseobject = createInstance OmniLight --> Omni Light
classof t --> Omnilight
superclassof t --> light
classof (superclassof t) --> node

Not sure if this was helpful, but I hope it was...

02-23-2012, 08:47 PM
Well that was a tad more in depth then my answer :S Thanks Bobo.

02-24-2012, 10:30 AM
@PEN - thanks for the answer. It's not something specific I'm trying to do, we just had a discussion about scripting naming convention, and considered whether we should use nodes or objects for function, parameter and variable names. For example, should we use:
fn doSomthing inObject = print inObject.name
fn doSomthing inNode = print inNode.name

@Bobo - thanks a lot for the detailed answer. This actually answers my question completely. Perhaps this explanation should find it's way into the maxscript help, as I would think there are others who would like to understand the difference between the two.
BTW, I really liked your "-->" notation to show results. That's a very clever use of comments.


CGTalk Moderation
02-24-2012, 10:30 AM