Page MenuHome

Fix T101946: Outliner data-block counter treats bones as collection
ClosedPublic

Authored by Philipp Oeser (lichtwerk) on Oct 22 2022, 12:39 PM.

Details

Summary

Mistake in own rBb6a35a8153c3 which caused code to always recurse into
bone hierarchies (no matter which collapsed level an armature was
found).
This led to bone counts always being displayed even outside a collapsed
armature (e.g. if an armature was somewhere down a object or collection,
the collapsed object or collection would show this bonecount).
This is inconsistent with other data counting in the Outliner, e.g.
vertexgroups or bonegroups do have their indicator at object level,
however the counter only shows if Vertex Groups or Bone Groups line
shows (so if the object is not collapsed).

And this also led to the bug reported in T101946 which was that the bone
counts would be treated as collections when further down a collapsed
hierarchy.
Background: The whole concept of MergedIconRow is based on the concept
of counting objects types or collectinons/groups. If other things
like overrides, vertexgroups or bonegroups are displayed in a counted/
merged manner, then these will always be counted in the array spots that
are usually reserved for groups/collections. But for things this is not
a problem (since these are only displayed below their respective
outliner entry -- and will never be reached otherwise).

So to correct all this, we now only recurse into a bone hierarchy if we
started off with an armature data-block (so the first shown thing would
be a "level-zero" bone).

NOTE: there are certainly other candidates for counted/merged display further up the hierarchy (not just bones -- constraints come to my mind here, but that is for another commit)

Diff Detail

Repository
rB Blender
Branch
T101946 (branched from master)
Build Status
Buildable 24381
Build 24381: arc lint + arc unit

Event Timeline

Philipp Oeser (lichtwerk) requested review of this revision.Oct 22 2022, 12:39 PM
Philipp Oeser (lichtwerk) created this revision.

I'm fine with the fix as it is, since it fix the problem for collections, and for bones is an improvement over what we had in 2.93.

Shouldn't is_level_zero_bone be is_root_bone? Or are they not the same?

I'm fine with the fix as it is, since it fix the problem for collections, and for bones is an improvement over what we had in 2.93.

Shouldn't is_level_zero_bone be is_root_bone? Or are they not the same?

"level zero" can also mean the following:
lets say you have a bone hierarchy of

  • bone
    • bone.001
      • bone.002
        • bone.003

bone is expanded, bone.001 is collapsed

Then bone.001 is what is called the "level_zero_bone" in the patch (level zero being the first bone upon which outliner_draw_iconrow is called from outliner_draw_tree_element.
No strong opinion about the naming, but "root_bone" sounds more like it would mean bone (instead of bone.001)?

Dalai Felinto (dfelinto) added 1 blocking reviewer(s): Julian Eisel (Severin).

level zero is probably fine in this case. I will let Julian review the code. But the functionality is good for me

"Level zero" is indeed confusing. I would describe it as something like either the root level of the collapsed subtree, or the direct children of the collapsed element to merge into.

source/blender/editors/space_outliner/outliner_draw.cc
3069

const

This revision is now accepted and ready to land.Oct 24 2022, 11:11 AM