Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import maya.cmds as cmds
- import maya.mel as mm
- #get mesh objects.
- meshes = maya.cmds.ls(type="mesh")
- for mesh in meshes:
- cmds.select(mesh)
- #check if attribute exists, if not, create.
- if not mm.eval( 'attributeExists "test" "%s"' % mesh):
- cmds.addAttr( shortName='tst', longName='test', dataType="string")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement