Mark-J
09-27-2010, 07:49 PM
I've just noticed that the return order of the cmds.listRelatives command is completely un predictable!.
Case in point, we have a structure, simple hierarchy:
Node1
Node1>Node2
Node1>Node2>Node3
Now if these are nurbsCurves then the return of the listRelatives cmd is in that order, top to bottom. If you do the same hierarchy from joints, the return order is inversed, bottom to top.
for jnt in cmds.listRelatives('Node1', type='joint', ad=True, f=True): print jnt
for node in cmds.listRelatives('Node1', type='nurbsCurve', ad=True, f=True): print node
Anybody know why the hell this would be? Just another random Maya issue, or is there actually a reason for this. Whatever it is, it's a pain in the arse when your doing generic hierarchy processing.
Back to the drawing board :(
Case in point, we have a structure, simple hierarchy:
Node1
Node1>Node2
Node1>Node2>Node3
Now if these are nurbsCurves then the return of the listRelatives cmd is in that order, top to bottom. If you do the same hierarchy from joints, the return order is inversed, bottom to top.
for jnt in cmds.listRelatives('Node1', type='joint', ad=True, f=True): print jnt
for node in cmds.listRelatives('Node1', type='nurbsCurve', ad=True, f=True): print node
Anybody know why the hell this would be? Just another random Maya issue, or is there actually a reason for this. Whatever it is, it's a pain in the arse when your doing generic hierarchy processing.
Back to the drawing board :(
