I've got a simple question regarding skinning/binding in Softimage.
A thing that I require to do quite often is to copy the weights from one vertex on the mesh, and paste them on multiple vertices on a different mesh. Assuming both meshes already have the appropriate clusters, weightmaps, and deformers assigned, I'm wondering how to achieve this.
I looked for a "Weight Copy" tool in SI, and didn't find one, so I turned to Google. I was able to find a tool that supposedly does this (SA_SetPointWeights), but for some reason, It's not working for me. I select the 'source' mesh and launch the tool, where I can select it, but for some reason, it cannot find the Weight Map, even though it is there (I've attached a screen capture included below...)
If anyone is familiar with this tool, do you know what's up with it?
Otherwise, I'm open to any other suggestions around how to copy/paste vertex weights. I don't have much time to script it myself right now, and I haven given the GEAR tools a try yet because I need to ask IT to change my machine's environment to reference their scripts, but if that toolset has tools for this, I can push the "please get it done" button to be able to use them.
Thanks for any suggestions!
--
Sergio Mucino
Lead Rigger
Modus FX
-------------------------- To unsubscribe: mail softimag...@listproc.autodesk.com with subject "unsubscribe" and reply to the confirmation email.
# "Equalize Selected Envelope Weights", code by Alan Fregtman # USAGE: Select some points on a mesh with an envelope, then run this. xsi = Application def main(): sel = xsi.Selection try: o = sel(0).SubComponent.Parent3Dobject selPts = sel(0).SubComponent.ComponentCollection env = o.Envelopes(0) except: xsi.LogMessage("Please select some enveloped points you wish to equalize!",2) return False envCls = (p.Target2 for p in env.InputPorts if p.Target2.Type == "envweights").next() envWeights = env.Weights.Array pIndices = selPts.IndexArray n = float( len(pIndices) ) newWeightsDict, dIndices = {}, {} # For every deformer for i, d in enumerate(env.Deformers): d = d.FullName # Get all weights of selected points dWeights = [envWeights[i][idx] for idx in pIndices] wSum = sum(dWeights, 0.0) # If they are in use if wSum > 0.0: # then find the average and note it down. newWeightsDict[d] = sum(dWeights, 0.0) / n dIndices[d] = i # This below is because weights come as untouchable tuples. :p envWeights = map(list,envWeights) # For every relevant deformer for d,i in dIndices.items(): # For every selected point for idx in pIndices: # Set the new averaged weight value! envWeights[i][idx] = newWeightsDict[d] # Finally, set our new weights :) env.Weights.Array = envWeights # Last but not least, find the construction history... ops = (x for x in envCls.NestedObjects if xsi.ClassName(x) == 'Operator') for op in ops: # and freeze the ops under the EnvWeights property. try: xsi.FreezeObj(op.FullName) except: pass # (They slow us down.) # ------------------------------------------------------------------- main() |
SA_Setpointweights was written by Simon Anderson and is for normal weightmap manipulation, not envelope weight stuff.
As Dave pointed out - Gator is a good place to start.
S.
On 2013/09/24 5:41 PM, Sergio Mucino wrote:
I've got a simple question regarding skinning/binding in Softimage.
A thing that I require to do quite often is to copy the weights from one vertex on the mesh, and paste them on multiple vertices on a different mesh. Assuming both meshes already have the appropriate clusters, weightmaps, and deformers assigned, I'm wondering how to achieve this.
I looked for a "Weight Copy" tool in SI, and didn't find one, so I turned to Google. I was able to find a tool that supposedly does this (SA_SetPointWeights), but for some reason, It's not working for me. I select the 'source' mesh and launch the tool, where I can select it, but for some reason, it cannot find the Weight Map, even though it is there (I've attached a screen capture included below...)
<mime-attachment.png>
If anyone is familiar with this tool, do you know what's up with it?
Otherwise, I'm open to any other suggestions around how to copy/paste vertex weights. I don't have much time to script it myself right now, and I haven given the GEAR tools a try yet because I need to ask IT to change my machine's environment to reference their scripts, but if that toolset has tools for this, I can push the "please get it done" button to be able to use them.
Thanks for any suggestions!
--
Sergio Mucino
Lead Rigger
Modus FX
-------------------------- To unsubscribe: mail softimag...@listproc.autodesk.com with subject "unsubscribe" and reply to the confirmation email.
--------------------------
To unsubscribe: mail softimag...@listproc.autodesk.com with subject "unsubscribe" and reply to the confirmation email.