Import/Export Skin Weights?

Hi

There is no built-in import/export skin weights in Blender.
Is this assessment correct?

I tried searching but nothing conclusive:

This one is left answered: save load skin weight data
This one is for BlenderMaya: [Addon] Export weights to Maya (.dsw format)

Is there a decent way to do it?

Maya stores weight using maps, In blender you could either use maps with the edit weight modifier, or possibly assign materials per vertex group and bake that out, that wouldn’t store the falloff though.

So short answer - I don’t think there’s a good way to do that.

You can link object data though, if you want to copy your weights across meshes.

You can use a vertex-group modulated UV warp modifier to export vertex weights to material, and from there to a texture. (UV to 0,0->use UV warp to move all UV to 1,0, multipled by vertex group->read UV.x.)

Exporting a bunch of weights as textures sounds like a huge pain to me though. My models have a hundred weight groups…

How do you want to map weights from one model to another? You could use a data transfer for most kinds of mappings (not UV-based mappings though).

Yes, maya would export/import a map for every bone, there’s a tool do do all of them at once. it’d be really painful to do that one by one.

That still wouldn’t store the falloffs though right? So anything with a value greater than 0 would stll be treated as 1?

That would store the true weights.

The UV warp modifier moves the UV from 0 to 1-- but is modulated by the vertex group. If you send it “head”, it will move a vertex with head 0.5 to UV 0.5, and it will move a vertex with head 0.7 to UV 0.7. Then you can read the UV in the material, and reading the UV is the same as reading the vertex group you want.

1 Like

Thanks for explaining! One never stops learning new things. :slight_smile:

@dan2 and @bandages

Thanks for the answer. Unfortunately, I had problem on both Link Data and Transfer Mesh Data
You can see the result here:
https://www.dropbox.com/s/4lve96r57f5wa5g/BLEN27_weght_transfer.mp4?dl=0

Here’s what I have done:

  1. Transfer Mesh Data from source to target geometry. Unfortunately, the only option is Vertex Groups and no Modifiers. In addition, even if I transferred Vertex Groups it only transferred only one group. Not all groups.

Back to step 1 again

  1. Link Object Data. It transfers the mesh, verified by the same name. Unfortunately, it does not transfer Vertex Group
  2. Fortunately, after fiddling with parameters, I saw Copy Vertex Groups to Linked. Works as expected
  3. Now, Link Modifiers.
  4. Finally, played timeline and you see the errors in the video above.

The source and target geo is exact replica. The target geo is just moved sideways for clarity.

Am I missing something here?

Is there a way around this?

@dan2
RE: Yes, maya would export/import a map for every bone,
Are you referring to the Skin>Export Weights Maps? Don’t use that. That’s obsolete and IMHO, should be removed. Confuses people.

Use Deform>Export Weights instead. Exports in a hard-coded .xml/.txt files.

Via data transfer modifier? It transfers all groups. You need to hit the generate data layers button down on the bottom of the modifier to create the groups’ listings if they don’t already exist on the object. Here’s settings that I typically use:

Notice “all layers”? “By name”? That’s transferring each vg on the basis of name. (As opposed to order.)

Remember that doing this transfers from the modified shape of the thing you’re transferring data from. You can’t stick an armature on one model then do a live data transfer of weights from it to a different model-- the original armature will be evaluated before the data transfer, and what was “nearest vertex” at rest will not be when it’s deformed.

1 Like

@bandages

Oh okay. Transfer Modifier. A modifier object rather than a command.
The groups where transferred properly.

RE: You can’t stick an armature on one model then do a live data transfer of weights from it to a different model

I’m not sure the limitation you are stating.
The thing is the “transferred vertex groups” are of no use to me if they can’t be used in an armature.

Here’s what I did so far

  1. Bind the same armature used in source geo to target geo
  2. Delete all the defacto vertex groups
  3. Transfer vertex groups from source geo to target geo
  4. Vertex group transferred
  5. However, the armature animation has no effect on the target geo despite (3 and 4)?

Is this normal or is there a way around this?

Create the data transfer modifier, set parameters, hit generate, apply modifier, create armature modifier (possibly via parenting menu). Did you do that last step?

1 Like

@bandages

I tried testing to transfer data in two scenario
A) Src and Geo are positioned in different world space (See video in the first post)
B) Src and Geo are dead smack similar in position.

A fails (result similar to first post). B succeeds.

With the result, I can conclude that the data transfer modifier transfers data using a world/local space set-up. Hence, the word “nearest”. Correct me if I’m wrong

I am not after that. Definitely not that.
I am after a one to one correlation where data is accurately per vertex order and not some guesses.

Is there another way of doing this? Again, preferably just simply an import/export weights.

P.S. I also tried the topology setting in vertex data, but to no avail

Yes. Look at your options for method. If you don’t want nearest, don’t use nearest. If your meshes are topologically identical, transfer by topology.

1 Like

@bandages

Yes, as mentioned above. I tried topology but only works if src and target geo is on the same worldspace. At least works decently. If they separated in space, it doesn’t work like the other options.

Nope, works for me. Play with it. Make sure it actually applied (it’s easy to forget some steps) by deleting groups before applying. Check that you actually have identical topology by testing on a fresh duplicate (with any generate modifiers applied.)

Hi,

Is there any development on this workflow?
The workaround above is hit and miss to me. And is prone to error. Since I need to have both armature to be in the same scene.

I just want to export a weight to a file. Then import them as needed.

Echo. Any word on this? Basic function that can be used to transfer and backup weight maps. I’m surprised there isn’t at least a Blender addon for it.

There is none yet because it’s a bit superfluous. I think it has already been mentioned, but:
Save your blend file, append the object or mesh data containing the vertex groups in the file where you need to import the vertex groups, then transfer vertex groups from one object to the other using the Data Transfer modifier or F3 > Transfer mesh data > Vertex group.
Writing an addon for this would be quite straightforward though. If you absolutely need it, maybe ask in the Paid Jobs forum, a developer would be certainly happy to do it for a reasonable rate.

Thanks, that’s good to know and I’ll keep that in mind for future reference. However I disagree that the ability to export all of the weights as a XML file is superfluous. In Maya whenever I finish rigging and weight painting a model I export the weights and save them with the model. That way, if in the future I decide to make minor adjustments I can unbind it, make the changes, rebind it, and import the vertex weights so I don’t lose any work. It’s pretty handy. Blender’s rigging toolset is amazing (I’m still a newbie and learning) but having this feature would be nice. The data is there, just needs a way to be written out.

Hi @sboerner and @lucky

Apologies for late response.
Someone actually has implemented a feature like this.
You can see it here:

I have been using it for the past few months. It works as expected.

Thank you! I’ll give it a try.

Although . . . now I wonder if I’m not fully appreciating Blender’s non-destructive workflow. In Maya, making any change to the mesh or skeleton of a rigged character requires reskinning. Maybe this is not the case in Blender?

Example: Adding shoes to a rigged character, which requires translating the mesh and armature a short distance from the ground and applying the transformations. I’m beginning to think that Blender’s live connection between the mesh and armature means you can do this without unparenting the mesh first. Correct?