Page MenuHome

LibOverride: support 'make override' for all selected items.
ClosedPublic

Authored by Bastien Montagne (mont29) on Jul 20 2022, 10:41 AM.

Details

Summary

This commit allows to select several data-blocks in the outliner and
create overrides from all of them, not only the active one.

It properly creates a single hierarchy when several IDs from a same
hierarchy root data are selected.

Diff Detail

Repository
rB Blender

Event Timeline

Bastien Montagne (mont29) requested review of this revision.Jul 20 2022, 10:41 AM
Bastien Montagne (mont29) created this revision.

Minor points inline, and then like discussed in person, if you want to do things more "the C++ way":

  • Use a C++ container instead of a C linked list (std::list, blender::Vector, etc.), then the items are cleaned up "automatically" (even on some kind of early scope exit on return, break or exceptions)
  • If there's still any cleanup left to do, do it in constructors, to get the same benefits.
source/blender/editors/space_outliner/outliner_tools.cc
865–869

I guess this should be disabled for the commit?

1101

I will leave it up to, but you could do this here:

for (auto [id_hierarchy_root_reference, id_root_list] : data.id_hierarchy_roots.items()) {
  ...
}

Handy syntax for these kind of pair/tuple bindings.

1102

Any reason for the _reference suffix? hierarchy_root_id/id_hierarchy_root seems fine.

Bastien Montagne (mont29) marked 3 inline comments as done.

Updated from review, makes it more C++-ish!

source/blender/editors/space_outliner/outliner_tools.cc
865–869

Yes indeed.

1101

Nice, like that! Similar to python unpacking.

1102

_reference reffer to the fact that this is a (linked) reference of an override (so _reference vs _override suffixes).

This revision is now accepted and ready to land.Jul 20 2022, 4:59 PM