MayaStringVariable

vtool.maya_lib.attr.MayaStringVariable(name) Convenience class for dealing with Maya string attributes.
class MayaStringVariable(name)

Convenience class for dealing with Maya string attributes.

TYPE_BOOL = ‘bool’
TYPE_DOUBLE = ‘double’
TYPE_ENUM = ‘enum’
TYPE_FLOAT = ‘float’
TYPE_LONG = ‘long’
TYPE_MESSAGE = ‘message’
TYPE_SHORT = ‘short’
TYPE_STRING = ‘string’
connect_in(attribute)

Connect the attribute into this variable.

Parameters:attribute (str) – ‘node.attribute’
connect_out(attribute)

Connect from the variable into the attribute.

Parameters:attribute (str) – ‘node.attribute’
create(node=None)

Create the variable on the node.

Parameters:node (str) – The node for the variable. If not set, set_node should be set.
delete(node=None)

Delete the variable on the node.

Parameters:node (str) – The node for the variable. If not set, set_node should be set.
exists()
Returns:bool
get_dict()

Get a dictionary that represents the state of the variable.

Returns:dict
get_name(name_only=False)

Get the name of the variable.

Parameters:name_only (bool) – If True just the variable name is returned. If False the node and variable are returned: “node.variable”.
get_value()

Get the variables value.

Returns:value
is_numeric()
load()

Refresh the internal values.

numeric_attributes = [‘bool’, ‘long’, ‘short’, ‘float’, ‘double’]
set_dict(var_dict)

Set a dictionary that describes the variable. See get_dict.

Parameters:var_dict (dict) – A dictionary created from get_dict.
set_keyable(bool_value)

Set the keyable state of the variable.

Parameters:bool_value (bool) –
set_locked(bool_value)

Set the lock state of the variable.

Parameters:bool_value (bool) –
set_name(name)

Set the name of the variable.

Parameters:name (str) –
set_node(name)

Set the node where the variable should live.

Parameters:name (str) –
set_value(value)

Set the value of the variable.

Parameters:value
set_variable_type(name)

Set the variable type, check Maya documentation.