See if an object has a specific attribute, Maya, Python

Posted by:

  1. if cmds.objExists(someObject + '.someAttribute'):
  2. print(' the attribute exists')
  3. else:
  4. cmds.addAttr(someObject, longName = 'someAttribute', attributeType = 'float' , minValue = 0, maxValue = 1, defaultValue = 1, keyable = True)

About the Author:

I RUN this joint! And I am a digital artist. BFA from the University of Colorado with an emphasis in 3D Animation. I worked in medical animation for some time. I then narrowly escaped with an only partially crushed spirit. Since then I have been expanding my skill set, reaching out into custom coding, game and app development.
  Related Posts

Add a Comment