Triple (hwx.inspire.Attributes)#

class Triple(default=(0, 0, 0), **kwds)#

Bases: Attribute

Store 3 float values.

Base class for Color, Direction, Location.

Attribute Table#

Name

Type

components

tuple

Method Table#

Name

Description

castForGet (self, obj, value)

castForSet (self, obj, value)

Converts and validates the triple value before setting.

create (self, obj)

Creates a triple attribute for the specified object.

getGuiValue (self, obj, format=’modeling’)

getValue (self, obj)

populateGuiValue (self, obj, prop, component=None)

setValue (self, obj, value)

Value#

alias of Vector

create(obj)#

Creates a triple attribute for the specified object.

castForSet(obj, value)#

Converts and validates the triple value before setting.

Parameters:
  • obj (GeneralObject) – Object this attribute belongs to.

  • value (str | list[float]) – Value of the attribute to set.

Returns:

Validated and converted value.

Return type:

math.Vector

castForGet(obj, value)#

Converts and returns the attribute value to its external type.

Parameters:
  • obj (GeneralObject) – Object this attribute belongs to.

  • value (Any) – Value of the attribute to be converted.

Returns:

Converted value.

Return type:

value (Any)

getValue(obj)#

Returns the attribute value of the specified object.

setValue(obj, value)#

Sets the value for the specified object attribute.

populateGuiValue(obj, prop, component=None)#

Override to customize, prop.value, displayValue, allowedValues.

The prop.value type determines which editor widget used: - bool -> checkbox - str -> line edit - hwtypes.Color -> color picker

Setting prop.allowedValues yields a ComboBox.

prop.displayValue is a str shown when the editor loses focus.

getGuiValue(obj, format='modeling')#

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