Last active
September 28, 2019 16:49
-
-
Save Roumenov/e38b4d18fb3c644e348fed476985744a to your computer and use it in GitHub Desktop.
move skinCluster weight values from one influence to another
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pymel.core as pm | |
#select the mesh, the source influence, and the target influence you want to move weights to | |
target_mesh, source_influence, target_influence = pm.ls(sl=1)[0:3]# unpack selection | |
target_skinCluster = target_mesh.listHistory(type='skinCluster')[0] # pm.mel.findRelatedSkinCluster(target_mesh) should also work | |
#verts = target_mesh.select("pSphere1.vtx[*]") | |
target_skinCluster.addInfluence(target_influence, weight = 0.0) | |
pm.select(target_mesh.vtx[:]) | |
pm.skinPercent(target_skinCluster, tmw=[source_influence, target_influence]) # the data from the first will be written to the second | |
pm.select(cl=1) | |
target_skinCluster.removeInfluence(source_influence) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment