vtool.maya_lib.attr¶
Class Summary
|
Convenience for dealing with connections. |
|
This saves the lock state, so that an attribute lock state can be reset after editing. |
|
This saves the lock state of the node, so that all attributes lock state can be reset after editing. |
|
|
|
Create a slider switch between multiple attributes. |
|
Creates attributes on a node that can then be used with OrientAttributes |
|
Convenience class for dealing with Maya attributes. |
|
Convenience class for dealing with Maya numeric attributes. |
|
Convenience class for dealing with Maya enum attributes. |
|
Convenience class for dealing with Maya string attributes. |
|
|
|
Still testing. |
|
Not fully implemented. |
|
Convenience class for dealing with multiply divide nodes. |
Function Summary
|
Get a variable instance for the attribute. |
|
|
|
Check if what is passed is an attribute. |
|
Check if the attribute exists and is numeric. |
|
Check if translate and rotate attributes are connected. |
|
|
|
|
|
|
|
Split a name between its node and its attribute. |
|
Get all the inputs into the specified node. |
|
Get all the outputs from the specified node. |
|
For a string node.attribute, return the attribute portion |
|
Get the input into the specified attribute. |
|
Get the outputs from the specified attribute. |
|
|
|
|
|
|
|
Transfer output connections from source_node to target_node. |
|
|
|
Lock and hide the attributes specified in attributes. |
|
Lock and hide keyable attributes on node. |
|
|
|
|
|
|
|
|
|
lock attributes on a node. |
|
unlock attributes on a node. |
|
|
|
|
|
This will check if the thing being passed in is a constraint. |
|
|
|
Removes user defined attributes from a node. |
|
Set the override color for the nodes in nodes. |
|
Maya 2015 and above. |
|
|
|
|
|
Get the override color for the given side. |
|
|
|
|
|
returns RGB |
|
returns HSV |
|
set the hue component of hsv |
|
set the saturation component of hsv |
|
set the value component of hsv |
|
Connect an X,Y,Z attribute, e.g. |
|
Connect translate, rotate, scale from source to target. |
|
Connect translate attributes |
|
Connect rotate attributes. |
|
Connect scale attributes. |
|
Connect translate attributes. If target_transform already has input connections, |
|
Connect translate attributes with a multiplyDivide to multiply the effect. |
|
Connect rotate attributes with a multiplyDivide to multiply the effect. |
|
Never use. |
|
Connect the visibility into an attribute |
|
|
|
Connect source_attribute into target_attribute with a plusMinusAverage inbetween. |
|
Not in use. |
|
Connect source_attribute into target_attribute with a multiplyDivide inbetween. |
|
Insert a multiply from the output of a source attribute into all the inputs of the source attribute |
|
Insert a multiply divide into the input attribute of target_attribute. |
|
Insert a multiply divide into the input attribute of target_attribute. |
|
Connect source 1 and source 2 into the target_attribute with and blendColors node. |
|
Connect source_attribute into target_attribute with a reverse node inbetween. |
|
Connect source_attribute into target_attribute with a condition node inbetween. |
Connect source_attribute into target_attribute with a condition node inbetween. |
|
Connect source_attribute into target_attribute with a condition node inbetween. |
|
|
Create an attribute to hook into a blendshape. |
|
Disconnect an attribute. |
|
|
|
Get the index values of a multi attribute. |
|
Find the next available slot in a multi attribute. |
|
Given a multi attribute, get all the slots currently made. |
|
Given a multi attribute, get all the slots currently made. |
|
Get the number of created slots in a multi attribute. |
|
|
|
Create an enum title attribute on node |
|
Convenience to tag nodes that are vital to the auto rig. |
|
Get the vetala type of the node. |
|
Get vetala nodes in the scene. |
|
Zero out the translation and rotate. |
|
Zero out the translation and rotate. |
|
Add orient attributes, used to automatically orient. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Connect the message attribute of input_node into a custom message attribute on destination_node |
|
|
|
|
|
|
|
|
|
|
|
Used to setup curl like setups. |
|
Adds a start and end value to attr_node and fades those over the target_nodes to the specified target_attr_name |
- class Connections(node)¶
Convenience for dealing with connections. Connection mapping gets stored in the class.
- Parameters
node (str) – The name of the node with connections.
- disconnect()¶
Disconnect all connections.
- disconnect_inputs()¶
Disconnect input connections.
- connect()¶
This is meant to be run after disconnect(). This will reconnect all the stored connections.
- refresh()¶
Refresh the stored connections
- get()¶
Get the stored connections. Input and Output connections in a list. List is ordered as [[output, intput], …], the output is whatever connects in, whether it be the node output
into something or something inputting into the node.
- get_input_at_inc(inc)¶
Get connection that inputs into the node at index.
- Parameters
inc (int) – The index of the connection.
- get_output_at_inc(inc)¶
Get connection that the node outputs into at index.
- Parameters
inc (int) – The index of the connection.
- get_connection_inputs(connected_node)¶
Get connections that input into the node. List is [[external_output, node_input], …]
- Parameters
connected_node (str) – The name of a connected node to filter with. Only inputs into the node will be returned.
- get_connection_outputs(connected_node)¶
Get connections that the node outputs into. List is [[node_output, external_input], …]
- Parameters
connected_node (str) – The name of a connected node to filter with. Only inputs from that node will be returned.
- Return
list: [[node_output, external_input], …]
- get_inputs_of_type(node_type)¶
Get nodes of node_type that connect into the node.
- Parameters
node_type (str) – Maya node type.
- Returns
The names of connected nodes matching node_type.
- Return type
list
- get_outputs_of_type(node_type)¶
Get all nodes of node_type that output from the node.
- Parameters
node_type (str) – Maya node type.
- Returns
The names of connected nodes matching node_type.
- Return type
list
- get_outputs()¶
Get all the connections that output from the node
- Returns
[[node_output, external_input], … ]
- Return type
list
- get_inputs()¶
get all connections that input into the node.
- Returns
[[external_output, node_input], … ]
- Return type
list
- class TransferConnections¶
- transfer_keyable(source_node, target_node, prefix=None, disconnect_source=False)¶
Create the keyable attributes on the target node found on source_node.
- Parameters
prefix (str) – The prefix to give. This is good when transferring more than once. This will help get rid of clashing attributes.
disconnect_source (bool) – TODO: Fill in description.
- class LockState(attribute)¶
This saves the lock state, so that an attribute lock state can be reset after editing.
- Parameters
attribute (str) – “node.attribute”
- unlock()¶
Unlock the attribute.
- lock()¶
Lock the attribute.
- restore_initial()¶
Restore the initial lock state.
- class LockNodeState(node)¶
This saves the lock state of the node, so that all attributes lock state can be reset after editing.
- Parameters
attribute (str) – “node.attribute”
- unlock()¶
Unlock the attribute.
- lock()¶
Lock the attribute.
- restore_initial()¶
Restore the initial lock state.
- class LockTransformState(node)¶
- lock()¶
Lock the attribute.
- restore_initial()¶
Restore the initial lock state.
- unlock()¶
Unlock the attribute.
- class RemapAttributesToAttribute(node, attribute)¶
Create a slider switch between multiple attributes. This is useful for setting up switches like ikFk. This will create the switch attribute if it doesn’t already exist.
- Parameters
node (str) – The name of a node.
attribute (str) – The attribute which should do the switching.
- set_keyable(bool_value)¶
Whether the switch attribute should be keyable. This only works if the attribute doesn’t exist prior to create()
- create_attributes(node, attributes)¶
Add attributes to be mapped. Saved in a list for create()
- Parameters
node (str) – The name of the node where the attributes live.
attributes (list) – The names of attributes on the node to map to the switch.
- create_attribute(node, attribute)¶
Add an attribute to be mapped. Saved in a list for create()
- Parameters
node (str) – The name of the node where the attributes live.
attribute (list) – The name of an attribute on the node to map to the switch.
- create()¶
Create the switch.
- class OrientJointAttributes(joint=None)¶
Creates attributes on a node that can then be used with OrientAttributes
- set_joint(joint)¶
Set a joint to create attributes on.
- Parameters
joint (str) – The name of the joint.
- get_values()¶
Get the orient settings in a dictionary.
- Returns
dict
- set_values(value_dict)¶
- set_default_values(context_sensitive=False)¶
Reset the attributes to default.
- delete()¶
Delete the attributes off of the joint set with set_joint.
- get_variable_instance(attribute)¶
Get a variable instance for the attribute.
- Parameters
attribute (str) – node.attribute name
- Returns
The instance of a corresponding variable.
- Return type
object
- get_variable_instance_of_type(name, var_type)¶
- class MayaVariable(name)¶
Convenience class for dealing with Maya attributes.
- TYPE_BOOL = 'bool'¶
- TYPE_LONG = 'long'¶
- TYPE_SHORT = 'short'¶
- TYPE_ENUM = 'enum'¶
- TYPE_FLOAT = 'float'¶
- TYPE_DOUBLE = 'double'¶
- TYPE_STRING = 'string'¶
- TYPE_MESSAGE = 'message'¶
- numeric_attributes = ['bool', 'long', 'short', 'float', 'double', 'double3']¶
- exists(force=False)¶
- Returns
bool
- is_numeric()¶
- set_name(name)¶
Set the name of the variable.
- Parameters
name (str) –
- set_value(value)¶
Set the value of the variable.
- Parameters
value –
- set_locked(bool_value)¶
Set the lock state of the variable.
- Parameters
bool_value (bool) –
- set_keyable(bool_value)¶
Set the keyable state of the variable.
- Parameters
bool_value (bool) –
- set_channel_box(bool_value)¶
- set_variable_type(name)¶
Set the variable type, check Maya documentation.
- set_node(name)¶
Set the node where the variable should live.
- Parameters
name (str) –
- get_value()¶
Get the variables value.
- Returns
value
- 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_dict()¶
Get a dictionary that represents the state of the variable.
- Returns
dict
- set_dict(var_dict)¶
Set a dictionary that describes the variable. See get_dict.
- Parameters
var_dict (dict) – A dictionary created from get_dict.
- 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.
- load()¶
Refresh the internal values.
- 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’
- class MayaNumberVariable(name)¶
Convenience class for dealing with Maya numeric attributes.
- get_max_value()¶
- set_min_value(value)¶
- Parameters
value (float) – Minimum value constraint
- set_max_value(value)¶
- Parameters
value (float) – Maximum value constraint
- set_variable_type(name)¶
Set the variable type, check Maya documentation.
- load()¶
Refresh the internal values.
- 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(force=False)¶
- 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()¶
- numeric_attributes = ['bool', 'long', 'short', 'float', 'double', 'double3']¶
- set_channel_box(bool_value)¶
- 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 –
- class MayaEnumVariable(name)¶
Convenience class for dealing with Maya enum attributes.
- set_enum_names(name_list)¶
- Parameters
name_list (list) – List of strings to define the enum.
- 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(force=False)¶
- 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', 'double3']¶
- set_channel_box(bool_value)¶
- 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.
- 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(force=False)¶
- 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', 'double3']¶
- set_channel_box(bool_value)¶
- 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.
- class StoreData(node=None, attribute_name='DATA')¶
- set_node(node)¶
- set_data(data)¶
- get_data()¶
- eval_data()¶
- 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 initialized 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.
- class MayaNode(name=None)¶
Not fully implemented. Meant to be a convenience class for dealing with maya nodes.
- class MultiplyDivideNode(name=None)¶
Convenience class for dealing with multiply divide nodes.
- Parameters
name (str) – The description to give the node. Name = ‘multiplyDivide_(name)’.
- set_operation(value)¶
Set the operation. 0 = no operation 1 = multiply 2 = divide 3 = power
default = 1
- Parameters
value (int) – The operation index.
- set_input1(valueX=None, valueY=None, valueZ=None)¶
Set the intput1 values
- Parameters
valueX (float) –
valueY (float) –
valueZ (float) –
- set_input2(valueX=None, valueY=None, valueZ=None)¶
Set the intput2 values
- Parameters
valueX (float) –
valueY (float) –
valueZ (float) –
- input1X_in(attribute)¶
Connect into input1X.
- Parameters
attribute (str) – The node.attribute to connect in.
- input1Y_in(attribute)¶
Connect into input1Y.
- Parameters
attribute (str) – The node.attribute to connect in.
- input1Z_in(attribute)¶
Connect into input1Z.
- Parameters
attribute (str) – The node.attribute to connect in.
- input2X_in(attribute)¶
Connect into input2X.
- Parameters
attribute (str) – The node.attribute to connect in.
- input2Y_in(attribute)¶
Connect into input2Y.
- Parameters
attribute (str) – The node.attribute to connect in.
- input2Z_in(attribute)¶
Connect into input2Z.
- Parameters
attribute (str) – The node.attribute to connect in.
- outputX_out(attribute)¶
Connect out from outputX.
- Parameters
attribute (str) – The node.attribute to connect out into.
- outputY_out(attribute)¶
Connect out from outputY.
- Parameters
attribute (str) – The node.attribute to connect out into.
- outputZ_out(attribute)¶
Connect out from outputZ.
- Parameters
attribute (str) – The node.attribute to connect out into.
- is_attribute(node_dot_attribute)¶
Check if what is passed is an attribute.
- Returns
bool
- is_attribute_numeric(node_dot_attribute)¶
Check if the attribute exists and is numeric.
- Returns
bool
- is_translate_rotate_connected(transform, ignore_keyframe=False)¶
Check if translate and rotate attributes are connected.
- Parameters
transform (str) – The name of a transform.
ignore_keyframe (bool) – TODO: Fill in description.
- Returns
bool
- is_connected(node_and_attribute)¶
- is_locked(node_and_attribute)¶
- is_keyed(node_and_attribute)¶
- get_node_and_attribute(attribute)¶
Split a name between its node and its attribute.
- Parameters
attribute (str) – attribute name, node.attribute.
- Returns
[node_name, attribute]
- Return type
list
- get_inputs(node, node_only=True)¶
Get all the inputs into the specified node.
- Parameters
node (str) – The name of a node.
node_only (bool) – Whether to return the node name or the node name + the attribute e.g. ‘node_name.attribute’
- Returns
The inputs.
- Return type
list
- get_outputs(node, node_only=True)¶
Get all the outputs from the specified node.
- Parameters
node (str) – The name of a node.
node_only (bool) – Whether to return the node name or the node name + the attribute e.g. ‘node_name.attribute’
- Returns
The outputs.
- Return type
list
- get_attribute_name(node_and_attribute)¶
For a string node.attribute, return the attribute portion
- get_attribute_input(node_and_attribute, node_only=False)¶
Get the input into the specified attribute.
- Parameters
node_and_attribute (str) – The node_name.attribute name to find an input into.
node_only (bool) – Whether to return the node name or the node name + the attribute e.g. ‘node_name.attribute’
- Returns
The attribute that inputs into node_and_attribute
- Return type
str
- get_attribute_outputs(node_and_attribute, node_only=False)¶
Get the outputs from the specified attribute.
- Parameters
node_and_attribute (str) – The node_name.attribute name to find outputs.
node_only (bool) – Whether to return the node name or the node name + the attribute e.g. ‘node_name.attribute’
- Returns
The nodes that node_and_attribute connect into.
- Return type
str
- transfer_attribute_values(source_node, target_node, keyable_only=True)¶
- get_attribute_values(node, keyable_only=True)¶
- set_attribute_values(node, values)¶
- transfer_output_connections(source_node, target_node)¶
Transfer output connections from source_node to target_node.
- Parameters
source_node (str) – The node to take output connections from.
target_node (str) – The node to transfer output connections to.
- set_nonkeyable(node, attributes)¶
- Parameters
node (str) – The name of a node
attributes (list) or (str) – The name of attributes or an attribute to set nonkeyable
- hide_attributes(node, attributes)¶
Lock and hide the attributes specified in attributes. This has been tested on individual attributes like translateX, not attributes like translate.
- Parameters
node (str) – The name of a node.
attributes (list) – A list of attributes on node to lock and hide. Just the name of the attribute.
- hide_keyable_attributes(node)¶
Lock and hide keyable attributes on node.
- Parameters
node (str) –
- hide_translate(node)¶
- hide_rotate(node)¶
- hide_scale(node)¶
- hide_visibility(node)¶
- lock_attributes(node, bool_value=True, attributes=None, hide=False)¶
lock attributes on a node.
- Parameters
node (str) – The name of the node.
bool_value (bool) – Whether to lock the attributes.
attributes (list) – A list of attributes to lock on node.
hide (bool) – Whether to lock and hide the attributes.
- unlock_attributes(node, attributes=None, only_keyable=False)¶
unlock attributes on a node.
- Parameters
node (str) – The name of the node.
attributes (list) – A list of attributes to lock on node. If none given, unlock any that are locked.
only_keyable (bool) – Whether to unlock only the keyable attributes.
- lock_translate_attributes(node)¶
- lock_rotate_attributes(node)¶
- lock_scale_attributes(node)¶
- lock_constraint(constraint)¶
This will check if the thing being passed in is a constraint.
And then lock the target offsets which can sometimes get messed up in reference.
- lock_attributes_for_asset(node)¶
- lock_hierarchy(top_transform, exclude_transforms=None, skip_of_type=None)¶
- remove_user_defined(node)¶
Removes user defined attributes from a node.
- set_color(nodes, color)¶
Set the override color for the nodes in nodes.
- Parameters
nodes (list) – A list of nodes to change the override color.
color (int) – The color index to set override color to.
- set_color_rgb(nodes, r=0, g=0, b=0)¶
Maya 2015 and above. Set to zero by default. Max value is 1.0.
- get_color_rgb(node, as_float=False)¶
- get_color(node, as_float=False)¶
- get_color_of_side(side='C', sub_color=False)¶
Get the override color for the given side.
- Parameters
side (str) – ‘L’,’R’, ‘C’
sub_color (bool) – Whether to return a sub color.
- Returns
A color index for override color.
- Return type
int
- color_to_rgb(color_index, as_float=True)¶
- hsv_to_rgb(hsv)¶
- get_random_color(seed=0)¶
returns RGB
- get_random_color_hsv(seed=0)¶
returns HSV
- set_color_hue(color_rgb, hue)¶
set the hue component of hsv
- set_color_saturation(color_rgb, saturation)¶
set the saturation component of hsv
- set_color_value(color_rgb, value)¶
set the value component of hsv
- connect_vector_attribute(source_transform, target_transform, attribute, connect_type='plus')¶
Connect an X,Y,Z attribute, e.g. translate, rotate, scale.
- Parameters
source_transform (str) – The name of a transform.
target_transform (str) – The name of a transform.
attribute (str) – eg, translate, rotate, scale.
connect_type (str) – ‘plus’ or ‘multiply’
- Returns
The nodes created.
- Return type
list
- connect_transforms(source_transform, target_transform)¶
Connect translate, rotate, scale from source to target.
- connect_translate(source_transform, target_transform)¶
Connect translate attributes
- Parameters
source_transform (str) – The name of a transform.
target_transform (str) – The name of a transform.
- connect_rotate(source_transform, target_transform)¶
Connect rotate attributes. This will automatically connect rotateOrder from source to target, if not already connected.
- Parameters
source_transform (str) – The name of a transform.
target_transform (str) – The name of a transform.
- connect_scale(source_transform, target_transform)¶
Connect scale attributes.
- Parameters
source_transform (str) – The name of a transform.
target_transform (str) – The name of a transform.
- connect_translate_into_pivots(source_transform, target_transform)¶
- connect_translate_plus(source_transform, target_transform)¶
- Connect translate attributes. If target_transform already has input connections,
reconnect with plusMinusAverage to accommodate both.
- Parameters
source_transform (str) – The name of a transform.
target_transform (str) – The name of a transform.
- Returns
the name of the plusMinusAverage node.
- Return type
str
- connect_translate_multiply(source_transform, target_transform, value=1, respect_value=False)¶
Connect translate attributes with a multiplyDivide to multiply the effect.
- Parameters
source_transform (str) – The name of a transform.
target_transform (str) – The name of a transform.
value (float) – The multiply value. Set to 0.5 to translate target half of what source translates.
respect_value (bool) – If respect value is True, then add a plus minus average to buffer the multiply divide.
- Returns
the name of the multiplyDivide node. If respect value return [multiply, plus]
- Return type
str
- connect_rotate_multiply(source_transform, target_transform, value=1, respect_value=False)¶
Connect rotate attributes with a multiplyDivide to multiply the effect. This is dangerous because rotate is not calculated in the same linear way as translate. Probably shouldn’t be used because of Quaternion math. Would be better to use a double orient constraint.
- Parameters
source_transform (str) – The name of a transform.
target_transform (str) – The name of a transform.
value (float) – The multiply value. Set to 0.5 to rotate target half of what source translates.
respect_value (bool) – If respect value is True, then add a plus minus average to buffer the multiply divide.
- Returns
the name of the multiplyDivide node. If respect value return [multiply, plus]
- Return type
str
- connect_scale_multiply(source_transform, target_transform, value=1, respect_value=False)¶
Never use.
- connect_visibility(attribute_name, target_node, value=True)¶
Connect the visibility into an attribute
- Parameters
attribute_name (str) – The node.attribute name of an attribute. Does not have to exists. Will be created if it doesn’t exist.
target_node (str) – The target node to connect attribute_name into.
value (bool) – 0 or 1 whether you want the visibility on or off by default.
- connect_plus_and_value(source_attribute, target_attribute, value)¶
- connect_plus(source_attribute, target_attribute, respect_value=False)¶
Connect source_attribute into target_attribute with a plusMinusAverage inbetween.
- Parameters
source_attribute (str) – The node.attribute name of an attribute.
target_attribute (str) – The node.attribute name of an attribute.
respect_value (bool) – Whether to edit the input1D list to accommodate for values in the target attribute.
- Returns
The name of the plusMinusAverage node
- Return type
str
- connect_plus_new(source_attribute, target_attribute, respect_value=False)¶
Not in use. Connect source_attribute into target_attribute with a plusMinusAverage inbetween. Tried to make it better, but isn’t.
- Parameters
source_attribute (str) – The node.attribute name of an attribute.
target_attribute (str) – The node.attribute name of an attribute.
respect_value (bool) – Whether to edit the input1D list to accommodate for values in the target attribute.
- Returns
The name of the plusMinusAverage node
- Return type
str
- connect_multiply(source_attribute, target_attribute, value=0.1, skip_attach=False, plus=True)¶
Connect source_attribute into target_attribute with a multiplyDivide inbetween.
- Parameters
source_attribute (str) – The node.attribute name of an attribute.
target_attribute (str) – The node.attribute name of an attribute.
value (float) – TODO: Fill in description.
skip_attach (bool) – Whether to attach the input into target_attribute (if there is one) into input2X of multiplyDivide.
plus (bool) – Whether to fix input connections in target_attribute to plug into a plusMinusAverage. Therefore, not losing their influence on the attribute while still multiplying by the source_attribute.
- Returns
The name of the plusMinusAverage node
- Return type
str
- output_multiply(source_attribute, value=1)¶
Insert a multiply from the output of a source attribute into all the inputs of the source attribute
- insert_multiply(target_attribute, value=0.1)¶
Insert a multiply divide into the input attribute of target_attribute.
- Parameters
target_attribute (str) – The node.attribute name of an attribute.
value (float) – The float value to multiply the target_attribute by.
- Returns
The new multiply divide.
- Return type
str
- insert_blend(target_attribute, value=1)¶
Insert a multiply divide into the input attribute of target_attribute.
- Parameters
target_attribute (str) – The node.attribute name of an attribute.
value (float) – The float value to blend the target_attribute by.
- Returns
The new blend node
- Return type
str
- connect_blend(source_attribute1, source_attribute2, target_attribute, value=0.5)¶
Connect source 1 and source 2 into the target_attribute with and blendColors node.
- Parameters
source_attribute1 (str) – The node.attribute name of an attribute.
source_attribute2 (str) – The node.attribute name of an attribute.
target_attribute (str) – The node.attribute name of an attribute.
value (float) – The amount to blend the 2 attributes.
- Returns
The name of the blendColors node
- Return type
str
- connect_reverse(source_attribute, target_attribute)¶
Connect source_attribute into target_attribute with a reverse node inbetween.
- Parameters
source_attribute (str) – The node.attribute name of an attribute.
target_attribute (str) – The node.attribute name of an attribute.
- Returns
The name of the reverse node
- Return type
str
- connect_equal_condition(source_attribute, target_attribute, equal_value)¶
Connect source_attribute into target_attribute with a condition node inbetween.
- Parameters
source_attribute (str) – The node.attribute name of an attribute.
target_attribute (str) – The node.attribute name of an attribute.
equal_value (float) – The value the condition should be equal to, in order to pass 1. 0 otherwise.
visibility. (Good when hooking up enums to) –
- Returns
The name of the condition node
- Return type
str
- connect_greater_than_condition(source_attribute, target_attribute, greater_than_value)¶
Connect source_attribute into target_attribute with a condition node inbetween.
- Parameters
source_attribute (str) – The node.attribute name of an attribute.
target_attribute (str) – The node.attribute name of an attribute.
- Returns
The name of the condition node
- Return type
str
- connect_less_than_condition(source_attribute, target_attribute, less_than_value)¶
Connect source_attribute into target_attribute with a condition node inbetween.
- Parameters
source_attribute (str) – The node.attribute name of an attribute.
target_attribute (str) – The node.attribute name of an attribute.
- Returns
The name of the condition node
- Return type
str
- create_blend_attribute(source, target, min_value=0, max_value=10, value=0)¶
Create an attribute to hook into a blendshape.
- Parameters
source (str) – The node.attr name of an attribute to connect into a blendshape.
target (str) – the blendshape.weight name to connect into.
min_value (int) – TODO: Fill in description.
max_value (int) – TODO: Fill in description.
value (int) – TODO: Fill in description.
- Returns
multiplyDivide node.
- Return type
str
- disconnect_attribute(attribute)¶
Disconnect an attribute. Find its input automatically and disconnect it.
- Parameters
attribute (str) – The name of an attribute that has a connection.
- disconnect_scale(transform_node)¶
- get_indices(attribute, multi=True)¶
Get the index values of a multi attribute.
- Parameters
attribute (str) – The node.attribute name of a multi attribute. E.g. blendShape1.inputTarget
multi (bool) – TODO: Fill in description.
- Returns
A list of integers that correspond to multi attribute indices.
- Return type
list
- get_available_slot(attribute)¶
Find the next available slot in a multi attribute.
- Parameters
attribute (str) – The node.attribute name of a multi attribute. E.g. blendShape1.inputTarget
- Returns
The next empty slot.
- Return type
int
- get_slots(attribute)¶
Given a multi attribute, get all the slots currently made.
- Parameters
attribute (str) – The node.attribute name of a multi attribute. E.g. blendShape1.inputTarget
- Returns
The index of slots that are open. Indices are returned as str(int)
- Return type
list
- get_slots_unique(attribute)¶
Given a multi attribute, get all the slots currently made.
- Parameters
attribute (str) – The node.attribute name of a multi attribute. E.g. blendShape1.inputTarget
- Returns
The index of slots that are open. Indices are returned as str(int)
- Return type
list
- get_slot_count(attribute)¶
Get the number of created slots in a multi attribute.
- Parameters
attribute (str) – The node.attribute name of a multi attribute. E.g. blendShape1.inputTarget
- Returns
The number of open slots in the multi attribute
- Return type
int
- clear_multi(node, attribute_name)¶
- create_title(node, name, name_list=None)¶
Create an enum title attribute on node
- Parameters
node (str) – The name of a node
name (str) – The title name.
name_list (list) – TODO: Fill in description.
- create_vetala_type(node, value)¶
Convenience to tag nodes that are vital to the auto rig.
- get_vetala_type(node)¶
Get the vetala type of the node.
- get_vetala_nodes(vetala_type=None)¶
Get vetala nodes in the scene.
- has_default_xform_channels(transform, skip_locked=False)¶
Zero out the translation and rotate. Set scale to 1.
- Parameters
transform (str) – The name of a transform node.
skip_locked (bool) – TODO: Fill in description.
- zero_xform_channels(transform)¶
Zero out the translation and rotate. Set scale to 1.
- Parameters
transform (str) – The name of a transform node.
- add_orient_attributes(transform, context_sensitive=False)¶
Add orient attributes, used to automatically orient.
- Parameters
transform (str) – The name of the transform.
context_sensitive (bool) – TODO: Fill in description.
- remove_orient_attributes(transform)¶
- show_rotate_order(transform, value=None)¶
- hide_rotate_order(transform)¶
- add_shape_for_attributes(transforms, shape_name)¶
- store_world_matrix_to_attribute(transform, attribute_name='origMatrix', skip_if_exists=False)¶
- search_for_open_input(node_and_attribute)¶
- get_message_attributes(node, user_defined=True)¶
- get_message_input(node, message)¶
- add_message(node, attribute)¶
- connect_message(input_node, destination_node, attribute)¶
Connect the message attribute of input_node into a custom message attribute on destination_node
- Parameters
input_node (str) – The name of a node. If input_node is None then only the attribute is created.
destination_node (str) – The name of a node.
attribute (str) – The name of the message attribute to create and connect into. If already exists than just connect.
- connect_group_with_message(input_node, destination_node, attribute)¶
- create_multi_message(node, attribute_name)¶
- fill_multi_message(node, attribute_name, nodes)¶
- append_multi_message(node, attribute_name, input_node)¶
- get_multi_message(node, attribute_name)¶
- drive_rotate(source_transform, source_attribute_name, target_transform, axis=None)¶
Used to setup curl like setups. Where a single source attribute drives the rotate of many.
- remap_multiple(attr_node, description, target_nodes, target_attr_name, keyable=True)¶
Adds a start and end value to attr_node and fades those over the target_nodes to the specified target_attr_name
- Parameters
attr_node (str) – The node to add start, end attributes to
description (str) – The description to give the start,end attributes. Eg. if description is twist the start,end attributes will be startTwist, endTwist.
targets_nodes (list) – The nodes to affect
target_attr_name (list) – The name of the attribute to affect on each target node. Eg. rotateX
target_attr_name – A list of str attribute names to affect on the target node. Eg. scaleY, scaleX