TransferWeight¶
vtool.maya_lib.deform.TransferWeight (mesh) |
Transfer weight has functions for dealing with moving weight from joints to other joints. |
-
class
TransferWeight
(mesh)¶ Transfer weight has functions for dealing with moving weight from joints to other joints.
Parameters: mesh (str) – The name of the mesh that is skinned with joints. -
transfer_joint_to_joint
(*args, **kwargs)¶ Transfer the weights from source_joints into the weighting of destination_joints. For example if I transfer joint_nose into joint_head, joint_head will lose its weights where joint_nose has overlapping weights. Source joints will take over the weighting of destination_joints. Source mesh must match the mesh TransferWeight(mesh).
Parameters: - source_joints (list) – Joint names.
- destination_joints (list) – Joint names.
- source_mesh (str) – The name of the mesh were source_joints are weighted. If None, algorithms assumes weighting is coming from the main mesh.
- percent (float) – 0-1 value. If value is 0.5, only 50% of source_joints weighting will be added to destination_joints weighting.
-
transfer_joints_to_new_joints
(*args, **kwargs)¶ Transfer the weights from joints onto new_joints which have no weighting. For example, joint_arm could move its weights onto [joint_arm_tweak1, joint_arm_tweak2, joint_arm_tweak3] Weighting is assigned based on distance.
Parameters: - joints (list) – Joint names to take weighting from.
- destination_joints (list) – Joint names to add weighting to.
- falloff (float) – The distance a vertex has to be from the joint before it has no priority.
- power (int) – The power to multiply the distance by. It amplifies the distnace, so that if something is closer it has a higher value, and if something is further it has a lower value exponentially.
- weight_percent_change (float) – 0-1 value. If value is 0.5, only 50% of source_joints weighting will be added to destination_joints weighting.
-