Blender Git Loki

Blenderin Git "master"-kehityshaaran kommitit.

Page: 491 / 5574

Revision 40aa69e by Julian Eisel
November 11, 2020, 18:09 (GMT)
Cleanup: Split header for Outliner tree building into C and C++ headers

See https://developer.blender.org/D9499.

It's odd to include a C++ header (".hh") in C code, we should avoid that. All
of the Outliner code should be moved to C++, I don't expect this C header to
stay for long.
Revision c2b3a68 by Julian Eisel
November 11, 2020, 18:09 (GMT)
Cleanup: Rename Outliner "tree-view" types to "tree-display" & update comments

See https://developer.blender.org/D9499.

"View" leads to weird names like `TreeViewViewLayer` and after all they are
specific to what we call a "display mode", so "display" is more appropriate.

Also add, update and correct comments.
Revision 01318b3 by Julian Eisel
November 11, 2020, 18:09 (GMT)
Cleanup: Follow C++ code style for new Outliner building code

See https://developer.blender.org/D9499.

* Use C++17 nested namespaces.
* Use `_` suffix rather than prefix for private member variables.

Also: Simplify code visually in `tree_view.cc` with `using namespace`.
Revision 43b4570 by Julian Eisel
November 11, 2020, 18:09 (GMT)
Cleanup: General cleanup of Outliner Blender File display mode building

See https://developer.blender.org/D9499.

* Turn functions into member functions (makes API for a type more obvious &
local, allows implicitly sharing data through member variables, enables order
independend definition of functions, allows more natural language for
function names because of the obvious context).
* Prefer references over pointers for passing by reference (makes clear that
NULL is not a valid value and that the current scope is not the owner).
* Reduce indentation levels, use `continue` in loops to ensure preconditions
are met.
* Add asserts for sanity checks.
Revision 44d8faf by Julian Eisel
November 11, 2020, 18:08 (GMT)
UI Code Quality: Convert Outliner Blender File mode to new tree buiding design

See https://developer.blender.org/D9499.

Also:
* Add `space_outliner/tree/common.cc` for functions shared between display
modes.
* I had to add a cast to `ListBaseWrapper` to make it work with ID lists.
* Cleanup: Remove internal `Tree` alias for `ListBase`. That was more confusing
than helpful.
Revision ad0c387 by Julian Eisel
November 11, 2020, 18:08 (GMT)
Cleanup: Put Outliner C++ namespace into `blender::ed` namespace, add comments

See https://developer.blender.org/D9499.

Also remove unnecessary forward declaration.
Revision 5fb6757 by Julian Eisel
November 11, 2020, 18:08 (GMT)
Fix possible null-pointer dereference in new Outliner tree building code
Revision dc9a52a by Julian Eisel
November 11, 2020, 18:08 (GMT)
Cleanup: Remove redundant parameter from new Outliner tree building code

See https://developer.blender.org/D9499.
Revision cad2fd9 by Julian Eisel
November 11, 2020, 18:08 (GMT)
Cleanup: Comments and style improvements for new Outliner C++ code

See https://developer.blender.org/D9499.

* Add comments to explain the design ideas better.
* Follow code style guide for class layout.
* Avoid uninitialized value after construction (general good practice).
Revision 6b18e13 by Julian Eisel
November 11, 2020, 18:08 (GMT)
UI Code Quality: Use C++ data-structures for Outliner object hierarchy building

See https://developer.blender.org/D9499.

* Use `blender::Map` over `GHash`
* Use `blender::Vector` over allocated `ListBase *`

Benefits:
* Significantly reduces the amount of heap allocations in large trees (e.g.
from O(n) to O(log(n)), where n is number of objects).
* Higher type safety (no `void *`, virtually no casts).
* More optimized (e.g. small buffer optimization).
* More practicable, const-correct APIs with well-defined exception behavior.

Code generally becomes more readable (less lines of code, less boilerplate,
more logic-focused APIs because of greater language flexibility).
Revision c9cc03b by Julian Eisel
November 11, 2020, 18:07 (GMT)
UI Code Quality: General refactor of Outliner View Layer display mode creation

See https://developer.blender.org/D9499.

* Turn functions into member functions (makes API for a type more obvious &
local, allows implicitly sharing data through member variables, enables order
independend definition of functions, allows more natural language for
function names because of the obvious context).
* Move important variables to classes rather than passing around all the time
(shorter, more task-focused code, localizes important data names).
* Add helper class for adding object children sub-trees (smaller, more focused
units are easier to reason about, have higher coherence, better testability,
can manage own resources easily with RAII).
* Use C++ iterators over C-macros (arguably more readable, less macros is
generally preferred)
* Add doxygen groups (visually emphasizes the coherence of code sections,
provide place for higher level comments on sections).
* Prefer references over pointers for passing by reference (makes clear that
NULL is not a valid value and that the current scope is not the owner).
Revision 249e4df by Julian Eisel
November 11, 2020, 17:51 (GMT)
UI Code Quality: Start refactoring Outliner tree building (using C++)

This introduces a new C++ abstraction "tree-display" (in this commit named
tree-view, renamed in a followup) to help constructing and managing the tree
for the different display types (View Layer, Scene, Blender file, etc.).

See https://developer.blender.org/D9499 for more context. Other developers
approved this rather significantly different design approach there.

----

Motivation

General problems with current design:
* The Outliner tree building code is messy and hard to follow.
* Hard-coded display mode checks are scattered over many places.
* Data is passed around in rather unsafe ways (e.g. lots of `void *`).
* There are no individually testable units.
* Data-structure use is inefficient.

The current Outliner code needs quite some untangling, the tree building seems
like a good place to start. This and the followup commits tackle that.

----

Design Idea

Idea is to have an abstract base class (`AbstractTreeDisplay`), and then
sub-classes with the implementation for each display type (e.g.
`TreeDisplayViewLayer`, `TreeDisplayDataAPI`, etc). The tree-display is kept
alive until tree-rebuild as runtime data of the space, so that further queries
based on the display type can be executed (e.g. "does the display support
selection syncing?", "does it support restriction toggle columns?", etc.).

New files are in a new `space_outliner/tree` sub-directory.

With the new design, display modes become proper units, making them more
maintainable, safer and testable. It should also be easier now to add new
display modes.
November 11, 2020, 14:10 (GMT)
Fix T82521: Bump OpenImageIO minimum version 1.8 > 2.2.1 for install_deps.sh

Since rB6fdcca8de64cd70f, we need at least OpenImageIO 2.1.12 to build
Blender.
November 11, 2020, 11:16 (GMT)
GPencil: Fix unreported crash when style is NULL

November 11, 2020, 09:40 (GMT)
Cleanup: correct argument order to callback

Currently the callback isn't used,
found when testing a new enum callback.
Revision 251b7d7 by Philipp Oeser
November 11, 2020, 09:27 (GMT)
Merge branch 'blender-v2.91-release' into master
November 11, 2020, 09:18 (GMT)
Fix T82553: Outliner F2 renaming issue when item is out of view

- scrolling would be restricted (usually, if the object to be renamed is
in view, this prevents scrolling away without finishing the rename
operation)
- renaming by typing and confirming with Enter was not possible (you
would have to escape, scroll to the object and use F2 again)
- other shortcuts like A and H are still active instead of being handled
as text input

Avoid all these issue by forcing the item into view using
outliner_show_active / outliner_scroll_view.

Maniphest Tasks: T82553

Differential Revision: https://developer.blender.org/D9521
November 11, 2020, 09:15 (GMT)
Cleanup: Use `NDEBUG` define, `DEBUG` one is not reliable.
November 11, 2020, 09:12 (GMT)
Fix 'outliner_scroll_view()' not reaching wanted element

Scrolling to an item after opening relevant parents can go wrong if said
parent e.g. the last in the list [as in: then the Outliner does not
scroll down all the way]
It stems from the fact that 'region->v2d.tot.ymin' is not up-to-date in
outliner_scroll_view after outliner_show_active opens up parents, 'tot'
will only update on a redraw.

Now calculate the trees height on the fly using
'outliner_tree_dimensions()'.

ref D9521
ref T82553

Maniphest Tasks: T82553

Differential Revision: https://developer.blender.org/D9523
November 11, 2020, 05:14 (GMT)
Fix T82602: checking image header reads past buffer bounds

Use the size argument to ensure checking the header doesn't read
past the buffer bounds when reading corrupt/truncated headers
from image files.
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021