[Mel] Help with repeating script!


#1

hello i need some help with Mel Script…
What i want to achieve is to unlock EVERY Attribute for Controler(NURBPrimitive).
for example:
CBunlockAttr “ControlerA.tx”;
CBunlockAttr “ControlerA.ty”;
CBunlockAttr “ControlerA.tz”;
CBunlockAttr “ControlerA.rx”;
CBunlockAttr “ControlerA.ry”;
CBunlockAttr “ControlerA.rz”;
CBunlockAttr “ControlerA.sx”;
CBunlockAttr “ControlerA.sy”;
CBunlockAttr “ControlerA.sz”;
CBunlockAttr “ControlerA.v”;

However, i have multiple Controlers say… ControlerA ~ ControlerZ…
Pls help me with running the script efficiently cuz there is no way of repeating above Mel for multiple times~ orz


#2

try this, it’s python but works for what you asked , just select objects or controllers you want unlock attributes for and run this,
it will unlock what ever attributes is locked for selected objects

nodes = cmds.ls(sl=1)
attrList  = cmds.listAttr(nodes,l=1)
for objects in nodes:
    for attr in attrList:
        cmds.setAttr(objects+'.'+attr,lock=0)

sorry its not MEL