1
$\begingroup$

Let's say I've imported a model and the importer has created an armature with some disconnected bones that shouldn't actually be disconnected. Specifically, this: demo 1

The first descendants of the wrist bone should be disconnected, but I'd like the finger bone chains to be properly connected. As an example, this is how the thumb should look: demo 2

How can I do this automatically? Something like:
1. Select all bones to be "fixed"
2. Run an operation
3. Done

So far, I'm stuck doing this manually, by placing the 3D cursor at each bone's head, deleting the bone, extruding a new one from its parent, placing the new bone's head where the 3D cursor is, and renaming it. This is pretty slow and cumbersome.

I can't benefit from Merge Bones (Within Chains), since it doesn't do anything (presumably because the bones are disconnected and not a proper chain). I've tried selecting two bones, two tails, two heads, or one tail + one head; all no luck.

Demo file (depicted by image 1)

$\endgroup$
2
  • $\begingroup$ Recommend adding armature to blend and uploading here blend-exchange.giantcowfilms.com Are the images posed, or the rest pose? Would suggest a script that creates new bones based on old bone orientations. $\endgroup$
    – batFINGER
    Mar 11, 2020 at 8:45
  • $\begingroup$ @batFINGER Rest pose. I've added the blend file as well. $\endgroup$ Mar 11, 2020 at 17:08

1 Answer 1

1
$\begingroup$

Quick Script.

As commented, might pay to upload file with armature if more detail like bone roll is required.

enter image description here

Similarly to Straighten all bone chains in an armature a quick little script (in this case) to move parent tail to child head, connect and remove last bone.

In edit mode, grab the parent bones of chains you wish to "flatten and connect"

import bpy
context = bpy.context
arm = context.object.data
for eb in context.selected_editable_bones:
    parent = eb        
    while len(parent.children):

        bone = parent.children[0]
        parent.tail = bone.head
        bone.use_connect = True
        parent = bone
    else:
        print("remove bone", parent.name)
        arm.edit_bones.remove(bone)

Note haven't done anything for bone roll. Would probably use the Y axis of original bone as Z or X axis of re-positioned bone

$\endgroup$
3
  • $\begingroup$ Thanks much, that script works like a charm. The bones already had the correct roll, so in my case, leaving bone roll unchanged is perfectly OK. $\endgroup$ Mar 11, 2020 at 17:10
  • $\begingroup$ Good to know. Thanks for the feedback. $\endgroup$
    – batFINGER
    Mar 11, 2020 at 17:20
  • $\begingroup$ When trying the script in Blender 2.79 I noticed the last bone in the chain that doesn't get changed gets removed. So if there is not an empty bone at the end it gets removed. I noticed it too late almost. When using the script above, I had to remove the else: part of it, and just manually adjusted those bones. So if using this script I recommend having empty end bones or removing that bit and change the last ones yourself manually. For the rest it works really well. In my cases I usually need to keep the roll intact and usually is just 90 degree increments. seriously thanks batFINGER. $\endgroup$ Jan 27, 2023 at 18:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .