Component Utilities¶
Code author: Jeremy Ernst
This module contains functions for returning information specific to components or functions that operate specifically on components.
Functions¶
check_for_childrenfind_associated_mover_from_jointget_all_created_jointsget_all_rig_asset_nodesget_component_instanceget_rig_asset_nodeget_top_level_moverreturn_all_componentssetup_global_scalevalidate_asset_namevalidate_prefixvalidate_suffix
-
check_for_children(joint)[source]¶ Checks if the given joint has any child components that are using it as their parent.
Parameters: joint (str) – Name of joint to check. Returns: Returns a list of components that were children of the joint. Return type: str, []
-
find_associated_mover_from_joint(joint_name)[source]¶ Gets the name of the joint mover (global, but offset if global doesn’t exist) that corresponds to the given name.
Parameters: joint_name (str) – The name of the joint whose corresponding mover to search for. Returns: The name of the joint mover that corresponds to the joint name. Return type: str
-
get_all_created_joints()[source]¶ Get all created joints from all components.
Returns: Returns a list of all joints that components will or have created. Return type: str, []
-
get_all_rig_asset_nodes()[source]¶ Returns all rig asset (character) nodes.
Returns: A list (str) of all rig asset network node names.
-
get_component_instance(network_node)[source]¶ Given a network node for a module, create an instance of the module and return it.
Parameters: network_node (str) – The name of the network node to gather the necessary information from to create an inst. Returns: Module instance Return type: class.instance
-
get_rig_asset_node()[source]¶ Returns the network node for the entire rig asset. If more than one asset node exists, an exception will be raised.
Returns: Network node name (str) that represents the entire asset.
-
get_top_level_mover(node)[source]¶ Gets the top-most global mover of a module.
Parameters: node (pymel.core.PyNode) – PyNode of the mover group for the module. Returns: Returns the name of the top-most global joint mover of the module.
-
return_all_components()[source]¶ Returns all network nodes belonging to components.
Returns: A list (str) of all rig module network node names.
-
setup_global_scale(mover)[source]¶ Sets up an aliasAttr so that only uniform scale is possible.
Parameters: mover (str) – Name of the node to setup the uniform scale.
-
validate_asset_name(name)[source]¶ Ensures that the given name is a valid name for Maya. :param str name: The name to validate. :return: Returns True if name is valid, otherwise False.
-
validate_prefix(metanode, prefix)[source]¶ Ensures that the given prefix is a valid name for Maya, as well as ensuring it has a trailing underscore. Also ensures that no other module exists with the new name, factoring in the adjusted prefix.
Parameters: - metanode – The rig module’s network node name.
- prefix – The prefix to validate.
Returns: Returns a valid prefix as a string. If the prefix was invalid, returns False
-
validate_suffix(metanode, suffix)[source]¶ Ensures that the given suffix is a valid name for Maya, as well as ensuring it has a leading underscore. Also ensures that no other module exists with the new name, factoring in the adjusted suffix.
Parameters: - metanode – The rig module’s network node name.
- suffix – The suffix to validate.
Returns: Returns a valid suffix as a string. If the suffix was invalid, returns False