Skip to main content

More Maya Scripting crap

My favourite target to complain about maya is the questionable transform node - shape node duality. This creates so many problems and i haven't really found a moment where it actually solves one. My limited knowledge of computer- and programming language design tells me that it was implemented to easier adress transform components in C or C++.

Nevertheless this system creates some unique behaviours of commands. The LS command for example doesn't know or care which transform is connected to a light shape node for example. Hence you can't ask it "Give me all light transform nodes", even though it has a "transform"-parameter. So we have this command:

ls( lights=True, transforms=True )

which returns all light shape nodes and all transform nodes of a scene. The parameters create the union of two different sets. In contrast this command:

ls( sl=True, dag=True, transforms=True )

returns all nodes that are selected, part of the hierachy and transforms. The parameters create the intersection of three sets.