Advertisement
Guest User

Untitled

a guest
Jul 1st, 2015
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. import maya.cmds as cmds
  2. import maya.mel as mm
  3.  
  4. #get mesh objects.
  5. meshes = maya.cmds.ls(type="mesh")
  6. for mesh in meshes:
  7. cmds.select(mesh)
  8.  
  9.  
  10. #check if attribute exists, if not, create.
  11. if not mm.eval( 'attributeExists "test" "%s"' % mesh):
  12. cmds.addAttr( shortName='tst', longName='test', dataType="string")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement