keyojimbo

Zero Translate Rotate Scale

Aug 26th, 2025
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. import maya.cmds as cmds
  2.  
  3. selection = cmds.ls(sl=True)
  4.  
  5. for object in selection:
  6. translate_attrs=['translateX', 'translateY', 'translateZ']
  7. rotate_attrs=['rotateX', 'rotateY', 'rotateZ']
  8. scale_attrs=['scaleX', 'scaleY', 'scaleZ']
  9.  
  10. for attr in translate_attrs:
  11. full_attr = f'{object}.{attr}'
  12. if not cmds.getAttr(full_attr, lock=True) and cmds.getAttr(full_attr, keyable=True):
  13. cmds.setAttr(full_attr, 0)
  14.  
  15. for attr in rotate_attrs:
  16. full_attr = f'{object}.{attr}'
  17. if not cmds.getAttr(full_attr, lock=True) and cmds.getAttr(full_attr, keyable=True):
  18. cmds.setAttr(full_attr, 0)
  19.  
  20. for attr in scale_attrs:
  21. full_attr = f'{object}.{attr}'
  22. if not cmds.getAttr(full_attr, lock=True) and cmds.getAttr(full_attr, keyable=True):
  23. cmds.setAttr(full_attr, 1)
Add Comment
Please, Sign In to add comment