Advertisement
Guest User

Untitled

a guest
Oct 17th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. import pymel.core as pm
  2. #select the mesh, the source influence, and the target influence you want to move weights to
  3.  
  4. target_mesh, source_influence, target_influence = pm.ls(sl=1)[0:3]# unpack selection
  5. target_skinCluster = target_mesh.listHistory(type='skinCluster')[0] # pm.mel.findRelatedSkinCluster(target_mesh) should also work
  6. #verts = target_mesh.select("pSphere1.vtx[*]")
  7. target_skinCluster.addInfluence(target_influence, weight = 0.0)
  8.  
  9. pm.select(target_mesh.vtx[:])
  10. pm.skinPercent(target_skinCluster, tmw=[source_influence, target_influence]) # the data from the first will be written to the second
  11. pm.select(cl=1)
  12. target_skinCluster.removeInfluence(source_influence)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement