Enum (hwx.inspire.core)

Store a string with a predefined list of allowed values and labels

Public Methods

classmethod splitValues (cls, options)
OnAttributeModify (self, obj, attr, *args)
castForSet (self, obj, value)
create (self, obj)
disable (self, obj)
enable (self, obj)
getDisplayNames (self, obj)
getGuiValue (self, obj)
getValueFromDisplayName (self, obj, displayName)
getValues (self, obj)
getValuesAndDisplayNames (self, obj, valuesOnly=False)
makeValueValid (self, obj)

Method Details

classmethod splitValues(cls, options)

Splits the specified options into values and displayNames.

OnAttributeModify(self, obj, attr, *args)

Callback method when the attribute gets modified.

castForSet(self, obj, value)

Converts and validates the enum values before setting.

param obj:Object this attribute belongs to.
type obj:GeneralObject
param value:Value of the attribute to set.
type value:List[str]
returns:Validated and converted value.
rtype:Enum
create(self, obj)

Creates an enum attribute for the specified object.

disable(self, obj)

Disables the attribute.

enable(self, obj)

Enables the attribute.

getDisplayNames(self, obj)

Returns the display name.

getGuiValue(self, obj)

Returns the formatted value, as shown in the Property Editor.

getValueFromDisplayName(self, obj, displayName)

Returns the value from the specified display name and object.

getValues(self, obj)

Returns the enum values.

getValuesAndDisplayNames(self, obj, valuesOnly=False)

Returns all the enum value and the display names for it.

makeValueValid(self, obj)

Make sure value is still valid after allowed values changes.