Maya Python: addAttr

# Adding a new string attribute
import maya.cmds as mc;
mc.select(cl=1);
null= mc.group(em=1);
attrName= "testAttr";
attrValue= "This is a test.";
mc.addAttr(null,sn=attrName,ln=attrName,dt="string");
mc.setAttr(null+"."+attrName,attrValue,type="string",l=1);
mc.select(null);

Comments

Popular posts from this blog

HIK: Getting current character and current source.