SplitMeshTarget

vtool.maya_lib.deform.SplitMeshTarget(…) Split a mesh target edits based on skin weighting.
class SplitMeshTarget(target_mesh)

Split a mesh target edits based on skin weighting. The target will be reverted back to the base mesh based on weight of the defined joints on weight mesh. Good for splitting blendshape targets.

Usage

split = SplitMeshTarget(‘smile’) split.set_base_mesh(‘home_mesh’) split.set_weight_mesh(‘weight_mesh’) split.set_weight_joint( ‘joint_weight_L’, suffix = ‘L’) split.set_weight_joint( ‘joint_weight_R’, suffix = ‘R’) split.create()

result = smileL and smileR meshes.

Parameters:target_mesh (str) – The name of a target mesh, eg. smile.
set_weight_joint(joint, suffix=None, prefix=None, split_name=True)

Set the a joint to split the shape. Must be skinned to the weight mesh

Parameters:
  • joint (str) – The name of the joint to take weighting from. Must be affecting weight mesh.
  • suffix (str) – Add string to the end of the target mesh name.
  • prefix (str) – Add string to the beginning of the target mesh name.
  • split_name (bool) – Wether to split the name based on “_” and add the suffix and prefix at each part.
  • 'smile_cheekPuff' would become 'smileL_cheekPuffL' if suffix = 'L' (eg.) –
set_weight_insert_index(joint, insert_index, insert_name, split_name=True)

Insert a string for the new target shape name. Needs to be tested!!

Parameters:
  • joint (str) – The name of the joint to take weighting from. Must be affecting weight mesh.
  • insert_index (int) – The index on the string where the insert_name should be inserted.
  • insert_name (str) – The string to insert at insert_index.
  • split_name (bool) – Wether to split the name based on “_” and add the insert_name at the insert_index.
set_weight_joint_replace_end(joint, replace, split_name=True)

Replace the string at the end of the target name when splitting. Needs to be tested!!

Parameters:
  • joint (str) – The name of the joint to take weighting from. Must be affecting weight mesh.
  • replace (str) – The string to replace the end with.
  • split_name (bool) – Weither to split the name based on “_”..
set_weight_joint_insert_at_first_camel(joint, insert_value, split_name=True)
set_center_fade(fade_distance, positive, suffix=None, prefix=None, split_name=True)
Parameters:
  • fade_distance (float) – The distance from the center that the target should fade off.
  • positive (bool) – Weither the fade off should start at positive or at negative.
set_weighted_mesh(weighted_mesh)

Set the weight mesh, the mesh that the weight joints are affecting through a skin cluster.

Parameters:weighted_mesh (str) – The name of a mesh with a skin cluster.
set_skip_target_rename(list_of_targets)
set_base_mesh(base_mesh)

Set the base mesh. The target mesh will revert back to base mesh based on skin weighting. This is the mesh with points at their default positions.

Parameters:base_mesh (str) – The name of a mesh.
set_search_for_children_meshes(bool_value)
create(*args, **kwargs)

Create the splits.

Returns:The names of the new targets.
Return type:list