import maya.cmds as cmds
def GetAllCurveJoint():
objs = []
curves = cmds.ls(type="nurbsCurve", ni=True, o=True, r=True, l=True)
joints = cmds.ls(type="joint", ni=True, o=True, r=True, l=True)
for i in curves:
objs.append(i)
for i in joints:
objs.append(i)
transforms = cmds.listRelatives(objs, p=True, type="transform")
return transforms
def UnlockAll():
locked = []
objs = GetAllCurveJoint()
for obj in objs:
attrs = cmds.listAttr(obj)
for attr in attrs:
try:
attrObj = "{0}.{1}".format(obj, attr)
if cmds.getAttr(attrObj, lock=True) == True:
cmds.setAttr(attrObj, lock=0)
locked.append(attrObj)
except ValueError:
continue
print(locked)
UnlockAll()
More than 1 year has passed since last update.
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme