mgear.flex.update module

flex.update

flex.update module handles the updating rig process

module:

flex.update

mgear.flex.update.update_attribute(source, target, attribute_name)

Updates the given attribute value

..note:: This in a generic method to setAttr all type of attributes

inside Maya. Using the getSetAttrCmds from the MPLug class allows avoiding to create one method for each type of attribute inside Maya as the setAttr command will differ depending on the attribute type and data.

This method is faster than using PyMel attribute set property.

Parameters:
  • source (str) – the maya source node

  • target (str) – the maya target node

  • attribute_name (str) – the attribute name to set in the given target

mgear.flex.update.update_blendshapes_nodes(source_nodes, target_nodes)

Update all target shapes with the given source shapes

Parameters:
  • source_nodes (list(str)) – source blendshape nodes

  • target_nodes (list(str)) – target blendshape nodes

mgear.flex.update.update_clusters_nodes(shape, weight_files)

Updates the given shape cluster weights using the given files

Parameters:
  • shape (str) – the shape node name containing the cluster deformers

  • weight_files (list(str)) – weight files names for each cluster deformer

mgear.flex.update.update_deformed_shape(source, target, mismatching_topology=True)

Updates the target shape with the given source shape content

Parameters:
  • source (str) – maya shape node

  • target (str) – maya shape node

  • mismatching_topology (bool) – ignore or not mismatching topologies

mgear.flex.update.update_maya_attributes(source, target, attributes)

Updates all maya attributes from the given source to the target

Parameters:
  • source (str) – maya shape node

  • target (str) – maya shape node

  • attributes (list) – list of Maya attributes to be updated

mgear.flex.update.update_plugin_attributes(source, target)

Updates all maya plugin defined attributes

Parameters:
  • source (str) – maya shape node

  • target (str) – maya shape node

mgear.flex.update.update_skincluster_node(source_skin, target_skin)

Updates the skin weights on the given target skin from the source skin

Parameters:
  • source_skin (str) – the source skin cluster node name

  • target_skin (str) – the target skin cluster node name

mgear.flex.update.update_transform(source, target)

Updates the transform node on target

This method creates a duplicate of the transform node on source and uses is as the new parent transform for the target shape

Parameters:
  • source (str) – maya shape node

  • target (str) – maya shape node

mgear.flex.update.update_transformed_shape(source, target, hold_transform)

Updates the target shape with the given source shape content

Parameters:
  • source (str) – maya shape node

  • target (str) – maya shape node

  • hold_transform (bool) – keeps the transform node position values

mgear.flex.update.update_user_attributes(source, target)

Updates the target shape attributes with the given source shape content

Parameters:
  • source (str) – maya shape node

  • target (str) – maya shape node

Note

This method loops twice on the use attributes. One time to add the missing attributes and the second to set their value. This allows avoiding issues when dealing with child attributes.

mgear.flex.update.update_uvs_sets(shape)

Forces a given mesh shape uvs to update