← All ideas
  • Published 24 Jan 2019

Ideas for improving set armature parent with automatic weights (rigging)

I was doing some rigging this morning and it didn't work due to a "Bone Heat Weighting: Failed to Find Solution for One or More Bones" error. There are a lot of references to this error on google so it seems that this is commonly encountered.

This is the workflow I used to overcome the problem:

  • created a low poly mesh using decimate unsubdivide (one iteration at a time, until the following step worked)
  • attached the armature to the low poly mesh using parent -> armature deform -> with automatic weights.
  • transferred the weights from the low poly mesh to the high poly mesh via data transfer modifier -> vertex data -> vertex group(s).
  • attached the armature to the high poly mesh using parent -> armature deform -> with empty groups.
  • smoothed the weights on all vertex groups in the high poly mesh because they were blocky (factor 1.00, iterations can't remember)

So my idea is a new operator which would probably be implemented as a python script (as an addon?) that would attempt to reliably do the parent -> armature deform step. this could potentially run for a long time so it would be nice if there was a UI with a progress bar of some kind.

psuedo code:

// entry point
function parent_armature(rig, original_mesh)
    // warn user if mesh contains unconnected parts
    // warn user if mesh contains duplicated vertices

    // try without using a low poly mesh version first
    success = armature_deform_with_automatic_weights(original_mesh, rig)
    if success return

    // try with progressively lower poly meshes until it works
    iterations = 0
    while (++iterations < max_iterations)
        success = parent_low_poly(original_mesh, rig, iterations)
        return if success

    fail
end

function parent_low_poly(original_mesh, rig, iterations)
     // TODO: if unsubdivide doesn't affect the vertex count much, could try other
     // decimate types.
     low_poly_mesh = unsubdivide(original_mesh, iterations)

     success = armature_deform_with_automatic_weights(low_poly_mesh, rig)
     if (success)
         transfer_vertex_group_weights(low_poly_mesh, original_mesh)
         smooth_weights(original_mesh)
         armature_deform_with_empty_groups(original_mesh, rig)
      end
      free(low_poly_mesh)
      return success
end
100%

Development Status: Open

Upvote 1 Downvote 0
sobakasu
24 Jan 2019

3 Comments

sobakasu Author

i'm not sure if i should be using this site because i've switched to left click select

sobakasu Author

looks like <code> has a css style of 'white-space: pre-line;' so the pseudo code is unreadable. the colour of the text is a bit hard to read too

jason

@Andrew: Make a proposal post and use the Meta tag. Then we'll try to get the CSS adjustments pushed upstream.