Blender Git Commit Log

Git Commits -> Revision 291136e

Revision 291136e by Sybren A. Stüvel (master)
May 19, 2020, 07:39 (GMT)
Fix T76689: Armature layers not indicating the existence of bones

From what I can see, there are two issues at play in {T76689} and its merged-in report {T76590}:

- In Blender ? 2.79 the bone layer dots were updated in the draw code. This ensured the info was up to date before drawing. This is no longer possible, as the drawing code uses evaluated objects, and those should not be written to. This has been addressed in rB709f126e8143 by calling the update function explicitly in various places in the code. The problem is that this wasn't added to all necessary spots.
- When in edit mode, changes are made to the edit bones but not to the 'actual' bones (this is synced when exiting edit mode). This causes undo to mess up the layer indicators.

I think both issues can be addressed by having the dependency graph update the used layer info as part of the armature evaluation. This will make the undo system work properly, and allows the removal of some `BKE_armature_refresh_layer_used()` from various places.

There is still the issue that there are two functions (`BKE_armature_refresh_layer_used()` and `ED_armature_edit_refresh_layer_used()`) that are both responsible for updating `bArmature::layer_used`. This is a trickier thing to solve, though, as the definition of the `EditBone` struct resides in the armature editor module. This means that blenkernel can't iterate over edit bones, but on the other hand the dependency graph shouldn't call any editor functions either. This is why I left the `ED_armature_edit_refresh_layer_used()` calls untouched.

The downside of recalculating `layer_used` from the dependency graph (at least in the way that I did it now) is that it is called every time a user moves a bone in pose mode. This frequency of updates is not necessary.

Differential Revision: https://developer.blender.org/D7709

Commit Details:

Full Hash: 291136eecea31c13232054accc2663dcdf7b2a33
Parent Commit: 888427c
Lines Changed: +20, -14

6 Modified Paths:

/source/blender/blenkernel/BKE_armature.h (+1, -1) (Diff)
/source/blender/blenkernel/intern/armature.c (+13, -5) (Diff)
/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc (+5, -1) (Diff)
/source/blender/editors/armature/armature_relations.c (+0, -3) (Diff)
/source/blender/editors/armature/pose_edit.c (+0, -2) (Diff)
/source/blender/makesrna/intern/rna_armature.c (+1, -2) (Diff)
By: Miika HämäläinenLast update: Nov-07-2014 14:18MiikaHweb | 2003-2021