def isWorldSpaceControl(obj):
#first, if the object itself doesn't inherit transforms, it's a world space node.
if not mc.getAttr(obj+'.inheritsTransform'):
return True
#walk up the hierarchy testing for any rotation value on x or z, or inherit transform
parent = mc.listRelatives(obj, parent=True)
while(parent):
if not mc.getAttr(parent[0]+'.inheritsTransform'):
return True
for attr in ('.rx','.rz'):
if mc.getAttr(parent[0]+attr) != 0:
return False
parent = mc.listRelatives(parent, parent=True)
return True
评论列表
文章目录