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

02 February 2012, 11: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 February 2012, 05: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 February 2012, 08:43 PM
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.

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 February 2012, 09:47 PM
Well that was a tad more in depth then my answer :S Thanks Bobo.

02 February 2012, 11: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
fn doSomthing inNode = print

@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 February 2012, 11:30 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.