def skin_frags(self):
cmds.cutKey(self.frags)
count = 0
for i in self.frags:
cmds.makeIdentity(i, apply=True)
skinCluster = cmds.skinCluster(i, self.fragJnts[count])
cmds.parent(self.fragJnts[count], self.scaleJnt)
count += 1
cmb = cmds.polyUniteSkinned(self.frags) #This is what makes it so slow!
cmds.rename(cmb[0], "Frags_Merged")
frags = cmds.ls(sl=True)
fragJnts = []
count = 0
for i in frags:
fragPos = cmds.xform(i, query=True, t=True)
cmds.select(clear=True)
jnt = cmds.joint(position=fragPos, name='Frag_' + str(count) + '_JNT')
cmds.parent(i, jnt)
fragJnts.append(jnt)
count += 1
sc = cmds.skinCluster(frags[0], fragJnts[0])
count = 1
for i in range(1, len(frags)):
cmds.skinCluster(sc, edit=True, addInfluence=fragJnts[count], geometry=frags[count], useGeometry=True) #Here I am trying to one-by-one add the joint and respective mesh, but haven't got that working yet either
count += 1
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/a89820b9-764a-4738-8246-9f099ec5712d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
I’m not in front of maya right now but a couple thoughts:
Did you try the polyUnite without retaining history?
cmds.polyUniteSkinned(self.frags, ch=False)
If you go the route of rebuilding a skinCluster from scratch on the final merged geometry, keep in mind that skinClusters can only deform one geometry, unlike many other deformers.
keep in mind that skinClusters can only deform one geometry
How do you mean? I think skinClusters can take on any number of meshes, like any other deformer.
@Aren Voorhees What is this for? Are you looking to transfer the animation of a transform onto the mesh, and zero out the transform?
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAD65uqnTQ9vDXfOXDUXuB%2B%2BNFukdnL00n76iA8zVB-6%3DLgw9Zw%40mail.gmail.com.
You can of course use the skinCluster -e -g “anotherGeom”, and it will “deform” this geometry, but it is not supported by the node.
Documentation is unclear about it:
http://help.autodesk.com/cloudhelp/2016/ENU/Maya-Tech-Docs/CommandsPython/skinCluster.html
The skinCluster binds only a single geometry at a time. Thus, to bind multiple geometries, multiple skinCluster commands must be issued.
http://help.autodesk.com/view/MAYAUL/2016/ENU/?guid=__cpp_ref_class_m_fn_skin_cluster_html
Note that unlike most deformers, a skinCluster node can deform only a single geometry. Therefore, if additional geometries are added to the skinCluster set, they will be ignored.
This last documentation excerpt is somehow misleading because if you add another geometry to the skinCluster via the deformer or the skinCluster command with the -e -geometry flags combination, the object will be deformed, but the skinCluster internal weights structure does not allow multiple geometries to be accessed by the node.
Anyway if anyone found a way to allow one skinCluster to deform multiple geometries, with the ability to paint weights on them, I’d be interested…
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOBfZRv9Dyq7kLhghT3HKN4sv0XcsAnh3W7Q9ZDi-7gHvw%40mail.gmail.com.
You can of course use the skinCluster -e -g “anotherGeom”, and it will “deform” this geometry, but it is not supported by the node.
Ah, yes you’re right. I was confusing this with skinning a combined mesh. Sorry to have made you dig up all of those links. :)
I’ve experimented in the past with a “fan-in-fan-out” sort of approach to that, where meshes were combined and then separated before and after a skinCluster node, but can’t remember whether it actually worked. There was issues with point numbers changing I think, though that seems fixable. But I suppose that’s quite off topic!
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/00c15039-59f6-4dce-8f63-3c23b0f4b022%40googlegroups.com.