Copying vertex weights

114 views
Skip to first unread message

Sergio Mucino

unread,
Sep 24, 2013, 11:41:54 AM9/24/13
to soft...@listproc.autodesk.com
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...)

SetPointWeight

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

David Gallagher

unread,
Sep 24, 2013, 1:26:44 PM9/24/13
to soft...@listproc.autodesk.com

Not exactly your need here, but make sure you're fully aware of GATOR. Transferring of skinning, maps, shapes is very powerful in Softimage.


On 9/24/2013 9:41 AM, 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...)


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.

Martin

unread,
Sep 24, 2013, 1:36:14 PM9/24/13
to soft...@listproc.autodesk.com
I'm not familiar with that tool, but Weight Map is not the same as Envelope Map.
It seems that this tool only works with Weight Maps and you have an Envelope Map in your object so I think it won't work unless you edit the code.

I think there was something like that in the Blur Tools. Maybe you could google that.
I also think SoftMonkey Envelope Tools had an envelope point copy thing. 

Haven't used SoftMonkey or Blur Tools in a while though.

Martin

Sandy Sutherland

unread,
Sep 24, 2013, 1:48:33 PM9/24/13
to soft...@listproc.autodesk.com
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.

Emilio Hernandez

unread,
Sep 24, 2013, 1:56:20 PM9/24/13
to soft...@listproc.autodesk.com
Here is a tutorial on Gator.

http://www.youtube.com/watch?v=wcGwvc2VCkk




2013/9/24 Sandy Sutherland <sandy.m...@gmail.com>

Alan Fregtman

unread,
Sep 24, 2013, 2:25:43 PM9/24/13
to XSI Mailing List
Hi Sergio,

Weightmap weights and envelope weights are not the same.

Try this code here... It averages the weighting on the selected points, which works great most of the time you want to have a zone with the same weighting, like a seam or whatever.


# "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()
It's awesome for manually fixing "thin-sided meshes" for example a plant leaf with just a tiny bit of thickness.



SetPointWeights.PNG

Martin

unread,
Sep 24, 2013, 2:36:20 PM9/24/13
to soft...@listproc.autodesk.com
I think you can partial gator since 2013 (I'm stuck with 2011 in this long project so I'm not really sure)
But still gator needs you to have your points in the same global position to copy their weights accurately.
So if you have your bones and meshes in a different global space and different polygon shape but same bone names, then it won't work, you'll need scripting.

Martin
Sent from my iPhone

On 2013/09/25, at 2:56, Emilio Hernandez <emi...@e-roja.com> wrote:

Here is a tutorial on Gator.

http://www.youtube.com/watch?v=wcGwvc2VCkk




2013/9/24 Sandy Sutherland <sandy.m...@gmail.com>
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.

Sergio Mucino

unread,
Sep 24, 2013, 2:59:24 PM9/24/13
to soft...@listproc.autodesk.com
Thanks a lot everyone!
GATOR won't help me in this situation, I think. I just need to take the weights from one vert, and paste them onto other verts. I use this mostly when I want to 'bind' geometry to a certain position on another mesh using weighting (since they're not separate objects I can constraint). If I average the weights (which is what a GATOR transfer seems to do), the object I'm 'attaching' will deform. However, if I sample the weights on one vertex, and paste them onto the vertices of the object I'm 'binding', I get a 'rigid' bind where the entire object will follow the one deforming. I hope I kinda explain it clearly.
I'll give your code a go Alan, and see how it goes. So far, I've been writing down the weights from the Weight Editor onto a sheet of paper, and entering it them manually on my target vertices, which has been (obviously) slow.
Thanks!


Sergio Mucino
Lead Rigger
Modus FX

Edy Susanto Lim

unread,
Sep 24, 2013, 11:15:41 PM9/24/13
to soft...@listproc.autodesk.com
Have you play with Gear Sergio?

The Deform >> Envelope >> Copy Weight Point 2 Point    might be what you are looking for

You can select a bunch of points, run that tool then pick the source point of where you want to copy the weight from.

-edy
Edy Susanto Lim
TD
http://sawamura.neorack.com

Sergio Mucino

unread,
Sep 25, 2013, 9:31:17 AM9/25/13
to soft...@listproc.autodesk.com
I'll push for getting GEAR set up on my workstation, and start using it. Thanks for the suggestion!


Sergio Mucino
Lead Rigger
Modus FX

Reply all
Reply to author
Forward
0 new messages