Page MenuHome

Active edit-bone isn't updating
Closed, ResolvedPublicBUG

Description

In edit mode selecting the bone doesn't activate it, making it draw brighter (update_armature_edit_mode_pointers needs to run again).

Solutions could include:

  • Depsgraph updating updating edit-mode pointers (ideally without doing a full copy of the armature).
  • Change armature edit data into a struct instead of a ListBase, then we wouldn't need to mange the active edit bone separately.
  • Use the original armature for drawing (is there any need to use the evaluated armature for edit-mode?).

This quick hack works but isn't nice.

diff --git a/source/blender/draw/intern/draw_armature.c b/source/blender/draw/intern/draw_armature.c
index b31ce22ebe9..3d64ea3dae6 100644
--- a/source/blender/draw/intern/draw_armature.c
+++ b/source/blender/draw/intern/draw_armature.c
@@ -1897,6 +1897,8 @@ static void draw_armature_edit(Object *ob)
   const bool show_relations = ((draw_ctx->v3d->flag & V3D_HIDE_HELPLINES) == 0);
 
   const Object *orig_object = DEG_get_original_object(ob);
+  const bArmature *arm_orig = orig_object->data;
+  BLI_assert(arm->edbo == arm_orig->edbo);
 
   for (eBone = arm->edbo->first, index = orig_object->runtime.select_id; eBone;
        eBone = eBone->next, index += 0x10000) {
@@ -1913,7 +1915,7 @@ static void draw_armature_edit(Object *ob)
         }
 
         /* set temporary flag for drawing bone as active, but only if selected */
-        if (eBone == arm->act_edbone) {
+        if (eBone == arm_orig->act_edbone) {
           boneflag |= BONE_DRAW_ACTIVE;
         }

Revisions and Commits