My MaxPlus packages have been a good way to get to know MaxPlus a little better and with practical examples sometimes I find myself hitting a wall, that’s what happened when I was trying to figure out how to check if an object was a FumeFx grid.
Normally, in Maxscript I would do a classof(object) and compare that to a string, should be more than enough, but getting to do that in MaxPlus became somewhat of a challenge since the documentation is still a bit rough. Thankfully with the help of Nicolas Genette and Larry Minton I had the problem solved and thought it would be good to share with you all.
import MaxPlus def getfumefxgrids(): """Helper function that returns a list with all FumeFx Grids in the scene """ nodes =  for node in MaxPlus.Core.GetRootNode().Children: if 'fumefx' in node.Object.GetClassName().lower(): nodes.append(node) return nodes
And that’s basically it, node.Object.GetClassName() which returns the top of the stack class name OR node.BaseObject.GetClassName() to get the base object class name, if you have modifiers on the object, these results might be different.
On a side note, this always returns a string, which in some cases might lead to having the same class name for two different types, the only way to uniquely check the class is via superclass id and class id.
Hope this helps and prevents hours of banging your head against the MaxPlus documentation 🙂