EnumAttribute

class cgp_maya_utils.scene.EnumAttribute(fullName)

Bases: cgp_maya_utils.scene.Attribute

attribute object that manipulates a enum attribute

classmethod create(node, name, items=None, value=None, connections=None, **__)

create an enum attribute

Parameters:
  • node (str) – node on which to create the attribute
  • name (str) – name of the attribute to create
  • items (list[str]) – items used to create the attribute
  • value (int or str) – value to set on the attribute
  • connections (dict) – connection to build on the attribute - {'source': node.attribute, 'destinations': [node.attribute ...]}
Returns:

the created attribute

Return type:

cgp_maya_utils.scene.EnumAttribute

data(skipConversionNodes=True)

data necessary to store the enum attribute on disk and/or recreate it from scratch

Parameters:skipConversionNodes (bool) – True : conversion nodes are skipped - False conversion nodes are not skipped
Returns:the data of the enum attribute
Return type:dict
items()

get the items of the enum attribute

Returns:the items of the enum attribute
Return type:list[str]
setValue(value)

set the value on the enum attribute

Parameters:value (float or str) – value to set on the enum attribute
value(asString=True)

the value of the enum attribute

Parameters:asString (bool) – True : value is returned as a string - False : value is returned as an integer
Returns:the value of the enum attribute
Return type:int or str