Message 1 of 2
copySkinWeight broken on Maya2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello 🙂, it appears as if the copySkinWeights command doesn't work properly for multiple mesh sources on Maya2023.
The following script creates a target cube and two source planes, and tries to copySkin from the planes to the cube. That completely fails in maya2023 with no error messages.
###############################################################
"""
Copy skin weights from multiple source meshes to a single
target mesh, is not working on Maya2023.
The following script creates a target cube and two source
planes. The last command tries to transfer the skin weights
from the planes to the cube.
As a result, while moving either "joint1" or "joint2",
should see the cube verts staying snapped to those of the two
planes. This is not the case for the current cut of Maya2023.
"""
###############################################################
import maya.cmds as cmds
# create objects
cmds.polyCube(w=1, h=0.2, ch=False, n="MSH_target")
cmds.polyPlane(w=1, h=1, sw=1, sh=1, ch=False, n="MSH_src_01")
cmds.select("MSH_src_01.vtx[0:3]", r=True)
cmds.move(0, 0.1, 0, r=True, ws=True)
cmds.polyPlane(w=1, h=1, sw=1, sh=1, ch=False, n="MSH_src_02")
cmds.select("MSH_src_02.vtx[0:3]", r=True)
cmds.move(0, -0.1, 0, r=True, ws=True)
cmds.select(cl=True)
cmds.joint()
cmds.setAttr("joint1.ty", 0.1)
cmds.setAttr("joint1.radius", 0.2)
cmds.select(cl=True)
cmds.joint()
cmds.setAttr("joint2.ty", -0.1)
cmds.setAttr("joint2.radius", 0.2)
# create skinClusters
cmds.select(["MSH_target", "joint1", "joint2"])
cmds.skinCluster()
cmds.select(["MSH_src_01", "joint1"])
cmds.skinCluster()
cmds.select(["MSH_src_02", "joint2"])
cmds.skinCluster()
# Copy skin multiple sources to single target
cmds.select(["MSH_src_01", "MSH_src_02", "MSH_target"])
cmds.copySkinWeights(noMirror=1,
surfaceAssociation="closestPoint", \
influenceAssociation="oneToOne")
###############################################################