Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import maya.cmds as cmds
- selection = cmds.ls(sl=True)
- for object in selection:
- translate_attrs=['translateX', 'translateY', 'translateZ']
- rotate_attrs=['rotateX', 'rotateY', 'rotateZ']
- scale_attrs=['scaleX', 'scaleY', 'scaleZ']
- for attr in translate_attrs:
- full_attr = f'{object}.{attr}'
- if not cmds.getAttr(full_attr, lock=True) and cmds.getAttr(full_attr, keyable=True):
- cmds.setAttr(full_attr, 0)
- for attr in rotate_attrs:
- full_attr = f'{object}.{attr}'
- if not cmds.getAttr(full_attr, lock=True) and cmds.getAttr(full_attr, keyable=True):
- cmds.setAttr(full_attr, 0)
- for attr in scale_attrs:
- full_attr = f'{object}.{attr}'
- if not cmds.getAttr(full_attr, lock=True) and cmds.getAttr(full_attr, keyable=True):
- cmds.setAttr(full_attr, 1)
Add Comment
Please, Sign In to add comment