Page MenuHome

Armature: Ensure Bone.use_connect is never True when bone has no parent

Authored by Demeter Dzadik (Mets) on Oct 20 2019, 1:34 AM.



This option makes no sense to be on without a parent. It's already grayed out in the UI, but still toggle-able.

This fixes an issue where the head of the bone can become invisible, when use_connect=True and parent=NULL.

You could argue the root of that problem is a missing check in the drawing code, but I would disagree. The drawing code basically assumes that if a bone doesn't have a parent, then use_connect is always false. This assumtion is totally reasonable, and with this patch, it's correct.

Diff Detail

rB Blender
use_connect_fix (branched from master)
Build Status
Buildable 5427
Build 5427: arc lint + arc unit

Event Timeline

Even in a 2 line patch I managed to make a mistake (indentation).

Demeter Dzadik (Mets) edited the summary of this revision. (Show Details)Oct 20 2019, 1:39 AM
Demeter Dzadik (Mets) retitled this revision from Bone.use_connect never true when bone has no parent to Armature: Ensure Bone.use_connect is never True when bone has no parent.Oct 20 2019, 1:47 AM

I don't think this is a good solution to attempt to solve this at the level of the Python API.

Existing scripts that construct an armature from code will break because of the order of operations will cause the resulting armature to silently ignore the connected value you set.

We can just leave this as-is since it's relatively harmless.

Edit, it's not so harmless since it means you cant select the head vertex, fixed rBf20cd49c3083: Fix bones without parents missing head vertex