Page MenuHome

Fix T59713: Armature layer dots not updated on changes
ClosedPublic

Authored by Germano Cavalcante (mano-wii) on Jul 17 2019, 3:40 PM.

Diff Detail

Repository
rB Blender

Event Timeline

Germano Cavalcante (mano-wii) edited the summary of this revision. (Show Details)
Germano Cavalcante (mano-wii) retitled this revision from Fix T67001: Studio and Flat lightning in single color do not respect clipping region to Fix T59713: Studio and Flat lightning in single color do not respect clipping region.
Germano Cavalcante (mano-wii) edited the summary of this revision. (Show Details)

Don't think this is an update problem in dependency graph: the layers act as "input" to it.
The operator seems to be missing a DEG_id_tag_update with ID_RECALC_GEOMETRY for the object where armatures are added to.

P.S. I am confused with title of this revision and the actual changes, not sure why this will be related on clipping region.

Germano Cavalcante (mano-wii) retitled this revision from Fix T59713: Studio and Flat lightning in single color do not respect clipping region to Fix T59713: Armature layer dots not updated on changes.Jul 17 2019, 3:54 PM

layer and layer_protected are user-edited data. If there is a problem with those when joining armature, that's something to be submitted as a separate fix.

The original report is only about layer_used runtime data, which controls the drawing of dots in the UI. The problem is that this is not getting refreshed properly. This used to happen in the drawing code, but was no longer working for reasons explained in:
rB2b09062defa0: COW Fix: The "layers used" display for armatures did not update after bones…

This could be handled as part of the dependency graph, but I'm not sure that's ideal either since this isn't about evaluated data.

The simple solution would be to rename rna_Armature_layer_used_refresh to BKE_armature_refresh_layer_used and move it to blenkernel. Then call that from all operators that can affect layer_used.

P.S. I am confused with title of this revision and the actual changes, not sure why this will be related on clipping region.

In a hurry I ended up copying the wrong report title X(

  • Rename rna_Armature_layer_used_refresh to BKE_armature_refresh_layer_used and move it to blenkernel
  • Call BKE_armature_refresh_layer_used in the join_armature operator

Looks good, now it can be added to more operators. From what I can tell these need it:

  • ARMATURE_OT_bone_primitive_add
  • ARMATURE_OT_delete
  • ARMATURE_OT_dissolve
  • ARMATURE_OT_fill
  • ARMATURE_OT_merge
  • ARMATURE_OT_separate
  • ARMATURE_OT_bone_layers
  • POSE_OT_bone_layers
  • Simplify parameter of the BKE_armature_refresh_layer_used;
  • Call BKE_armature_refresh_layer_used in ARMATURE_OT_bone_primitive_add, ARMATURE_OT_delete, ARMATURE_OT_dissolve and ARMATURE_OT_separate

I wonder why it is necessary to refresh the layer_used when calling the operators ARMATURE_OT_fill, ARMATURE_OT_bone_layers and POSE_OT_bone_layers
Although ARMATURE_OT_fill creates new bones they copy the data from the existing bones and don't change the layers used.
The two other operators do not add, destroy or move bones between layers.

Fill adds the bone on the active layer as far as I can tell, and that one may be empty and become used.

The bone_layers operators move bones to another layer.

Adding a bone with shift + A also does not seem to update the dots in the latest patch.

  • Call BKE_armature_refresh_layer_used in ARMATURE_OT_fill, ARMATURE_OT_bone_layers and POSE_OT_bone_layers

You're right, ARMATURE_OT_fill adds the bones to the active layers
And I confused the layers parameter of the other operators

I also noticed adding a new armature with shift + A in object mode does not immediately show used layers, when entering edit mode.

source/blender/makesrna/intern/rna_armature.c
302–303

This line should be moved into BKE_armature_refresh_layer_used, otherwise layers are never cleared.

Brecht Van Lommel (brecht) requested changes to this revision.Jul 17 2019, 6:12 PM
This revision now requires changes to proceed.Jul 17 2019, 6:12 PM
Germano Cavalcante (mano-wii) marked an inline comment as done.Jul 17 2019, 6:41 PM
Germano Cavalcante (mano-wii) updated this revision to Diff 16479.
  • Fix refresh of layers used for EditBones
  • Clean layer_used before refreshing
This revision is now accepted and ready to land.Jul 17 2019, 6:52 PM
  • separate_armature operator: refresh layers of the new armature