Attributes

vtool.maya_lib.attr.Attributes(node) Still testing.
class Attributes(node)

Still testing. Convenience class for dealing with groups of attributes. Currently only works on bool, long, short, float, double

Parameters:node (str) – The name of the node where the attributes live.
numeric_attributes = [‘bool’, ‘long’, ‘short’, ‘float’, ‘double’]
delete_all(retrieve=False)

Delete all loaded variables on a node.

create_all()

Meant to be used after delete_all to restore the attributes.

delete(name)

delete the attribute by name

Parameters:name (str) – The name of an attribute on the node.
create(name, var_type, index=None)

Create an attribute on the node. This refreshes all the attributes.

Parameters:
  • name (str) – The name of the attribute.
  • var_type (str) – The type of variable.
  • index (int) – The index where the attribute should be created. 0 would make it the first attribute.
get_variables()

Get the variables initialized to the var class

Returns:A list of var classes initalized to work on variables on the node.
Return type:list
get_variable(attribute_name)

Get a variable by name initialized to the var class.

Parameters:attribute_name (str) – The name of a variable on the node.
Returns:An instance of the var class.
Return type:object
rename_variable(old_name, new_name)

Rename a variable. This will work in such a way that the variables are all reset.

Parameters:
  • old_name (str) – The old name of the variable.
  • new_name (str) – The new name of the variable.