Hey all... I was wondering if anyone knew of a way to query the node inheritance hierarchy WITHOUT having to create an instance of a particular node?
Ie, if you use nodeType(node, hierarchy=True), I can get the information I want, but this requires you to already have an instance of the node whose class hierarchy you want to query. What I'd ideally like is something that would allow you to feed in a class name, and return the inheritance information.
I don't need the entire hierarchy given to me - anything that will let me get, say, parents or children of a class would work fine. Oh, and the answer can be API-level or script level. And finally, I know that with the API I can just get the inheritance hierarchy of the API types... unfortunately, the API hierarchy differs slightly from the maya node hierarchy (or at least, it does in Maya 2008). As an example,
QUOTE
import maya.cmds as cmds
light = cmds.spotLight()
print cmds.nodeType(light, inherited=True)
will return:
QUOTE
[u'entity', u'dagNode', u'shape', u'light', u'renderLight', u'nonAmbientLightShapeNode', u'nonExtendedLightShapeNode', u'spotLight']
...whereas if you look at maya docs / api / hierarchy then go to MFnBase for spotLight you'll see it goes:
QUOTE
MFnBase, MFnDependencyNode, MFnDagNode, MFnLight, MFnNonAmbientLight, MFnNonExtendedLight, MFnSpotLight
Note that the maya node hierarchy contains an element MISSING from the API hierarchy - 'renderLight'.