Outliner: Port view layer elements to new tree-element code design #110920

Merged
Julian Eisel merged 105 commits from :temp-r-layer-refactor into main 2023-08-11 14:52:16 +02:00
Contributor

No user visible changes expected.

Part of #96713, continuation of work started in 249e4df110 and 2e221de4ce.
Refer to these for a motivation and design overview.

Adds a new class for view layer elements.

No user visible changes expected. Part of #96713, continuation of work started in 249e4df110 and 2e221de4ce. Refer to these for a motivation and design overview. Adds a new class for view layer elements.
Almaz-Shinbay added 1 commit 2023-08-08 12:04:03 +02:00
Almaz-Shinbay added 1 commit 2023-08-08 12:04:35 +02:00
buildbot/vexp-code-patch-coordinator Build done. Details
5558f38e8e
Merge branch 'main' into temp-r-layer-refactor

@blender-bot build

@blender-bot build
Almaz-Shinbay requested review from Julian Eisel 2023-08-08 13:21:10 +02:00
Julian Eisel requested changes 2023-08-10 17:59:25 +02:00
Julian Eisel left a comment
Member

The changes for TSE_R_LAYER_BASE should are not strictly related and as such should be committed separately (e.g. to make it easier to track them down in case they cause bugs, and to give them a dedicated commit message).

Committed a89c104972 and c19caff2dc, so this will need to be updated (expect small merge conflicts).

The changes for `TSE_R_LAYER_BASE` should are not strictly related and as such should be committed separately (e.g. to make it easier to track them down in case they cause bugs, and to give them a dedicated commit message). Committed a89c104972 and c19caff2dc, so this will need to be updated (expect small merge conflicts).
Almaz-Shinbay added 102 commits 2023-08-10 18:10:45 +02:00
be8e8a1e20 Nodes: add Floored Modulo mode to Math nodes
Both the `Math` node and the `Vector Math` currently only explicitly
support modulo using truncated division which is oftentimes not the
type of modulo desired as it behaves differently for negative numbers
and positive numbers.

Floored Modulo can be created by either using the `Wrap` operation or
a combination of multiple `Math` nodes. However both methods obfuscate
the actual intend of the artist and the math operation that is actually
used.

This patch adds modulo using floored division to the scalar `Math` node,
explicitly stating the intended math operation and renames the already
existing `"Modulo"` operation to `"Truncated Modulo"` to avoid confusion.
Only the ui name is changed, so this should not break compatibility.

Pull Request: #110728
4ce3b01f4c Color management: Refactor OCIO config to be CIE XYZ I-E based
The change is motivated by using the actual CIE standard, preparing for the
Spectral Cycles, and making followup AgX integration more straight forward.

On a user level this change renames XYZ space to Linear CIE-XYZ D65, and
introduces Linear CIE-XYZ E.

The aliases are configured so that the backward compatibility is preserved.
The forward compatibility will be achieved by committing an alias name to the
3.6 release branch.

Ref #110685
fe8658aaad Fix (unreported) missing handling of ViewLayer IDProperties in foreach_id code.
Yet another 'obviously' missing bit in foreach_id processing found and fixed.
39834492cf Fix (unreported) collection 'readfile' expand incorrect assertion.
Naming is bad and confusing, but the 'expander' code path from readfile
can also be used outside of the reading context (see e.g.
`BKE_blendfile_write_partial` code). So code cannot assume that it is
exclusively working on data freshly read from file.

This should be renamed - but should also be probably replaced by
proper usage of the more generic 'foreach_id' code anyway, see #105134.

Found while investigating #109588.
dfe13a8ef8 GPU: Framebuffer: Add multi viewport support
This add the possibility to define different
viewports inside a single framebuffer and
let the vertex shader decide which viewport
to render to.

This only contain the GL and VK implementation.
The Vulkan implementation works but still
has a validation error related to shader features
and extension. The test passes nonetheless.

Pull Request: #110923
45751bd652 Nodes: experimental node previews in the shader editor
First implementation of node previews in the shader node editor. Using
the same user interface as compositor node previews, most shader nodes
can now be previewed (except group in/output and material output).

This is currently still an experimental feature, as polishing of the
user experience and performance improvements are planned. These will
be easier to do as incremental changes on this implementation.

See #110353 for details on the work that remains to be done and known
limitations.

Implementation notes:

We take advantage of the `RenderResult` available as `ImBuf` images to
store a `Render` for every viewed nested node tree present in a
`SpaceNode`. The computation is initiated at the moment of drawing nodes
overlays.

One render is started for the current nodetree, having a `ViewLayer`
associated with each previewed node. We separate the previewed nodes in
two categories: the shader ones and the non-shader ones.
- For non-shader nodes, we use AOVs which highly speed up the rendering
  process by rendering every non-shader nodes at the same time. They are
  rendered in the first `ViewLayer`.
- For shader nodes, we render them each in a different `ViewLayer`, by
  rerouting the node to the output of the material in the preview scene.

The preview scene takes the same aspect as the Material preview scene,
and the same preview object is used.

At the moment of drawing the node overlay, we take the `Render` of the
viewed node tree and extract the `ImBuf` of the wanted viewlayer/pass
for each previewed node.

Pull Request: #110065
1307239566 Fix #110931: Knife Tool does not work with extreme clip distances
Due to precision issues, when clip distance is too large,
`ED_view3d_unproject_v3` may return values `inf`, `nan` or close to
`FLT_MAX` when NDC is `1.0`.

Resolve this issue by using `ED_view3d_win_to_segment_clipped` instead.
052feddd02 Cleanup: workaround clang-format issue with LISTBASE_FOREACH macro
Surrounding LISTBASE_FOREACH by braces causes bad formatting in some
cases, workaround this with dummy statements.
04bd993a3c Cleanup: remove 'struct' prefix from GHOST/Wayland types
Move struct members into sub-structs (wl/wp/xdg/xkb) to prevent
naming collisions with the types & struct members.
06600bbbca Cleanup: remove unsafe string API use
This was only enabled WITH_GHOST_DEBUG, getKeyString now returns
a static string instead of filling in a buffer.
76c734a999 Fix #110721: "show_gizmo" does not switch off all gizmos
Not all gizmos were hidden when "show_gizmo" was disabled (most notably
python defined gizmos).
This was working in the 3DView and the Sequencer, but not respected in
the Clip Editor and Image/UV Editors.

Now check the flag prior to `WM_gizmomap_draw`.

Probably good for LTS.

Pull Request: #110932
1d4579d0e8 Fix #110632: context.temp_override(area=context.area) fails to restore
A context area/region override would be left cleared when the context
manager exited - if the overriding value matched the current value.

- `self->ctx_init.*_is_set` members would be set even if the those
  arguments weren't passed in, because the values would compare
  as different to NULL (unset).

- When restoring the context, setting a window clears the area & region,
  setting the area clears the region.
  This wasn't taken into account - only the members that were
  overridden were restored.

In the case of #110632, the window & region were detected as changed,
even though neither were overridden.
So the window & region were restored. The area however was set to it's
self and not marked as changed, so the area was left cleared from the
call that restored the window.

Resolve by fixing the check for overridden members & restoring
context members that will have been cleared indirectly.
fe24160080 Node panels: New DNA and C++ API for node group interfaces
Part 1/3 of #109135, #110272

Adds a new DNA structure for defining node group interfaces without
using `bNodeSocket` and with additional node UI item types.

Node group interfaces are organized as a hierarchy of "items", which
can be sockets or panels. Panels can contain both sockets and other
panels (although nested panels beyond the root panel may be disabled to
avoid complexity on the user level).

Sockets can be added to the interface in any order, not just the
conventional outputs..inputs order. Sockets can be marked as both input
and output, generating 2 sockets on node instances.

The C++ API in the DNA struct allows manipulating the interface
declaration by adding and removing items, moving them inside the
interface or into a different panel.

Pull Request: #110885
78afe126fd Cleanup: LIST_SWAP re-definition warning
Happens on Apple M2 platform. Caused by indirectly included queue.h
via tbb, which has its own LIST_SWAP.

Rename our macro to `LISTBASE_SWAP` to avoid conflicts.

Pull Request: #110943
0899d1c808 Remove compatibility code for blendfiles from early 2.80 development era.
Remove the 'SceneCollection' structure definition from DNA, and the
compatibility code converting it to the 'modern' viewlayer system.

'SceneCollection' was part at some point of the new collection system
during 2.80 development, but was never in any published Blender release.
So this code was only ensuring compatibility with a few potential
Blender files saved from in-development builds over four years ago.

Implements #110918.

Pull Request: #110926
4d73205606 Fix #109201: Consistent mapping boundaries of brush textures
This fix makes it so the circular brush is fitted into the square
texture. This seems to be the most straightforward way to resolve
confusion of the inter-dependencies between different brush and
texture options.

Pull Request: #110896
4c221959bf GPv3: Include other channel selection modes
Support extend and extend range channel selection.

Some channeltype don't have active channel and they don't support
`extend range`. This is done in `animchannel_has_active_of_type`.
Add switch case for new GPv3 channels in above `ANIM_is_active_channel`
to detect active channels and support `extend range`

Part of #110056

Pull Request: #110791
f439e13362 PyAPI: add-on name-spacing for extension repositories
Support name-spaced add-ons, exposed via user configurable extension
repositories.

Directories for add-ons can be added at run-time and are name-spaced to
avoid name-collisions with Python modules or add-ons from other
repositories.

This is exposed as an experimental feature "Extension Repositories".

Details:

- A `bUserExtensionRepo` type which represents a repository which is
  listed in the add-ons repository.

- `JunctionModuleHandle` class to manage a package with sub-modules
  which can point to arbitrary locations.

- `bpy.app.handlers._extension_repos_update_{pre/post}` internal
  callbacks run before/after changes to extension repositories,
  callbacks are used to sync the changes to the Python package that
  exposes these to add-ons.

- The size of an add-on name has been increased so a user-defined package
  prefix can be included without enforcing shorter add-on names.

- Functionality relating to package management has been left out of this
  change and will be developed separately.

Further work:

- While a repository can be renamed, enabled add-ons aren't renamed.
  Eventually we might want to support this although we could also
  disallow renaming repositories with add-ons enabled as the name isn't
  all that significant.

- Removing a repository should remove all the add-ons located in this
  repository.

- Sub-module names are currently restricted to `[A-Za-z]+[A-Za-z0-9_]*`
  we might want to relax this to allow unicode characters (we might
  still want to disallow `-` or any characters that would prevent
  attribute access in code).

Ref !110869.

Reviewed By: brecht
f43fcd3733 Cleanup: rename addon_utils._initiazlize to _initiazlize_once
Make it clear this is only intended to be called once.
9126210ddd PyAPI: make addon_utils.paths_with_extension_repos an internal function
This is only needed for internal use at the moment, rename to make it
clear it's only for internal use.

Also remove unnecessary variable assignments.
a63f511b52 Nodes: define rna of nodes in node file instead of rna_nodetree.cc
The goal is to be able to define a node in as few files as possible. Currently,
RNA definitions for nodes are put in `rna_nodetree.cc`. However, it seems
surprisingly simple to move them from there to the node files. Of course this
means that `makesrna.cc` won't generate these properties and their accessor
functions anymore. Fortunately, C++ lambdas and the preprocessor make it
fairly straight forward to generate those without the `makesrna` preprocessor.
Using the preprocessor here is not great of course, but I'd argue that it feels
less magical than it was before, so it's an improvement.

This patch changes a few files to test the feasibility of this approach. Eventually,
this approach should be used by all nodes. It can't be used for shader nodes for
now, because cycles still relies on the C++ API generated by RNA.

Right now, only properties are defined the node files. The `StructRNA` is still
generated by `makesrna`. It seems feasible to generate it at runtime as well
though with potentially minor RNA API changes. This is related to #75724.

Pull Request: #110840
56010232b9 Cleanup: Noisy warnings caused by different defines for sse2neon
The issue is visible on Apple Silicon when building Cycles.

Cycles includes sse2neon.h via two code paths: own CPU headers and
Blender's headers. The Blender headers will request higher precision
defines and Cycles does not need it (not for the kernel anyway, as
it has measurable performance penalty).

The solution is to wrap defines in the BLI_simd.h with check, so
that the flags are not re-defined.

The Blender's integration in Cycles does not really care if those
operations are precise or not, as the actual computations are done
elsewhere.

Pull Request: #110953
c218aaf795 Nodes: Hide the node preview button when the overlays are disabled
When the overlays are hidden or the previews overlays are hidden, it is
more consistent to have the preview toggle button hidden than shown.

This patch also removes the preview rendering when the previews are
hidden.

Pull Request: #110949
379182da48 macOS: Enable support for EDR rendering
Add a High Dynamic Range option in the Color Management > Display panel.
This enables display of extended color ranges above 1.0 for the 3D
viewport, image editor and render previews.

This requires a monitor that can display HDR colors, and a view
transform designed for HDR output. The Standard view transform works,
but Filmic does not as it was designed to bring values into the 0..1
range for SDR displays.

This patch is limited to allowing the display to visualize extended
colors, but does not include future looking work to better integrate HDR
into the full workflow.

It is implemented by rendering to high bit-depth texture formats for
the user interface, and uncapping the color range in color management.

Authored by Apple: Michael Parkin-White

Pull Request: #105662
2b49cca036 Silence unused variable warning, from an intermediate PR.
The first part of the node panels PR has an unused API call that will be
reenabled with the next stages (#110885).
b02f647c2b OBJ: fix import of files with really large polygons (e.g. 7000 vertices in one poly)
Bug report #110948: a file with a polygon so large that a single line
is 140 kilobytes. The previous limit was 64kb, increase the read file
chunk limit to 256kb. Still not fully robust, would need a more
complex fix to support arbitrarily large line length limits.
06cd0af2e5 GPv3: Refactor: replace `remove_frame_at` function
Instead of removing frames one by one, the `GreasePencil::remove_frames`
function now expects a span of frame numbers, replacing the
`GreasePencil::remove_frame_at` function.
Now, when drawings need to be deleted, we shrink the array only once.

Pull Request: #110957
1fb5e95f15 Fix #110447: Curves random selection is reversed
In edit mode, the "Select Random" operator selected the inverse.
For a probability of 1, no elements were selected and vice versa.

This was because the selection actually deselects elements, but used a
mask of elements that was not inverted.

The fix takes the complement of the mask of elements, so the deselection
now does the right thing.

Pull Request: #110963
5d52f39134 Color management: Improve no-op color space detection
Make it so transform between color spaces which is a no-op does not
peroform any calculations.

This was initially found when working on #110941, but the issue can
be replicated easily by renaming "Linear" to "Linear Rec.709" and
adding alias as "Linear".

Doing so would result in a failure of the compositor_matte_test.
The reason for that is due to the image data-block still referring
to the "Linear" color space, the name-based comparison not detecting
that "Linear" and "Linear Rec.709" are the same spaces, and that the
cryptomatte requires bit-perfect floating point values.

Pull Request: #110959
d63632b8cb Cleanup: GPv3: Use `int64_t` for indices
Instead of `int` use `int64_t`.
2f07ca487e CMake: wrap long lines, especially option descriptions
Wrap text to fit in the column width and encourage descriptive text.
4451b97745 GPv3: Include summary and datablock keyframes in the grease pencil dopesheet
This patch includes keyframes for both the summary channel, and grease pencil data-block channels.
It also includes selection in these channels, in the same modes as the ones implemented for grease pencil keyframes.

Pull Request: #110962
7f7614e4d7 Color management: Add and Rename Colorspaces
This is the next step towards AgX view transform project.

This is a sanitization pass over the existing color space names, as well as
addition of some new spaces. For example, the name Linear makes no sense when
there are a bunch of Linear spaces. An aliases are included for backwards
compatibility.

Some of the space descriptions and family tags are also updated., which also
involves in putting `False Color` to `inactive_colorspaces` instead of using
`family: display` filtering.

The spaces are now:

- Linear components of the display spaces
  - Linear Rec.709
  - Linear DCI-P3 D65
  - Linear Rec.2020
- Linear ACES spaces
  - ACES2065-1
  - ACEScg (Changed from `Linear ACEScg` to `ACEScg` since ACEScg already
    implied a linear transfer function, otherwise using `Linear AP1 ACES`
    might make more sense. Same goes for ACES2065-1)
- Linear FilmLight E-Gamut
  This is for AgX's LUT input encoding. It can potentially be useful for interop.
- Display spaces
  - sRGB
  - Display P3
  - Rec.1886
  - Rec.2020
- Filmic Components
  - Filmic Log
  - Filmic sRGB
  - False Color

Ref #110685

Pull Request: #110941
1fd04ff11a Fix EEVEE-Next: Shadow: Missing shadow on first frame
This was caused by the free unused data pass in the
init phase that would reset the clip data of the first
tilemap.

Uploading and checking for an invalid index fixes the
issue.
cc68cbe4a3 GPU: Avoid silent errors during shader compilation
To this end, replace some printf by std::cerr.
fab957279a Build: patch OSL to avoid duplicate symbols in static libraries
This was revealed by CMake refactoring in #110394, with the solution
identified by Ray Molenkamp.

Upstream: https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1709

Pull Request: #110974
8094bb8cf1 Fix (partially) wrong RNA path for 'ViewShading' data.
This commit fixes the RNA path reported from the struct owned by the
Scene.display data. Paths generated for the View3D space remain
completely broken (but whole 'space' paths are broken anyway).
4db71149f6 Fix (unreported) LSAN suppression list removing almost all (valid!) errors.
The last supression rule (`leak:libasan*`) would match almost all
detected cases, since the first line is almost always something like
that:
  #0 0x7f71040d85bf in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:69

Not sure if that was already the case when this suppression rule was
added, or if things changed in newer versions of ASAN/LSAN...
71d9bb9a66 Fix Weld modifier generating invalid mesh
Bug identified in #110942.

In cases where the last corners of a polygon are out of context, the
`weld_iter_loop_of_poly_next` iterator skips these corners.

This means that some corners of the resulting mesh do not have the
value set, which can even result in infinite loops.

The solution was not simple. The iterator had to be practically redone
to not use the `loop_end` member (which caused the problem).

Fortunately the code is more simplified with this change.
48f5862dd1 Nodes: use auto registration for nodes
The goal here is to reduce the number of files that need to be edited when
adding a new node. To register a node, one currently has to add a line to
`node_geometry_register.cc` and `node_geometry_register.hh` (for geometry
nodes). Those files can be generated automatically.

There is a new `NOD_REGISTER_NODE` macro that nodes can use to register
themselves. The macro is then discovered by `discover_nodes.py` that generates
code that calls all the registration functions. The script also works when the
register functions are in arbitrary namespaces. This allows simplifying the node
code as well.

In the past I tried a few times to get auto-registration working without resorting to
code generation, but that never ended up working. The general idea for that would
be to use non-trivial initialization for static variables. The issue always ends up
being that the linker just discards those variables, because they are unused and it
doesn't care if there are side effects in the initialization.

Related discussion regarding using Python for code generation:
https://devtalk.blender.org/t/code-generation-with-python/30558

Pull Request: #110686
86769cdb41 Cleanup: use actual function type instead of void* in declaration
This updates the signature of `RNA_def_property_update_runtime`
which previously just has a `const void *` input. This made it difficult
to know what function signature is expected and also does not result
in compile errors when a wrong function is provided.

There is one case which required a different signature, so now there
is a separat function for that case.
64bcce602e CMake: refactor flag checking function to take multiple argument pairs
Many calls to add_check_c_compiler_flag add_check_cxx_compiler_flag
resulted in over long lines & visual noise. Replace with a function that
takes multiple (cache_var flag) pairs to reduce duplication.
5168b71ce5 Fix building WITH_PYTHON=OFF after discover_nodes.py inclusion
Recently [0] added PYTHON_EXECUTABLE as a build time dependency.
Define PYTHON_EXECUTABLE even with WITH_PYTHON=OFF.

[0]: 19912457c6
5a78173073 Fix error in recent refactor to add_check_c{xx}_compiler_flag functions
The variable needs to be set in the parents scope.
8527ae2e80 CMake: show WITH_HYDRA on first installation
Also disable OSL for lite builds, only makes a difference when cycles is
enabled for lite builds.
8c866c2b92 Build: set the encoding in discover_nodes.py
The encoding is platform dependent, ensure utf-8 is always used.
53ab184f14 CMake: fix windows build and warning
Missing underscore in platform/platform_win32.cmake
and a quote too many in macros.cmake
3b50628bb9 Fix annotation tool getting "stuck" with IC-Keymap
The annotation tool only exited on LMB or RMB mouse buttons,
now check for all mouse buttons with special behavior with RMB.
92786e7448 Cleanup: use _get() suffix for GHOST/Wayland methods
Avoid variables shadowing methods for common names such as
scale & outputs.
2597ba9f5d Fix #110789: Apply NLA mapping when jumping to keys in the Graph Editor
The new keyframe jumping code for the graph editor did not respect the NLA strip offset.
This patch fixes that by applying `ANIM_nla_mapping_apply_fcurve`

Technical side note: `FCurve *` lost its constness due to that

Pull Request: #110790
a726d8cac2 Fix: Compilation issue GCC13 with Vulkan
Has been reported by different developers that the Vulkan
backend doesn't compile on GCC13.

Pull Request: #110992
433de97b06 Animation: Right align slider unit text
The text used to be centered around a point left of the slider line
with the assumption that it displays a number from 0-1 and "%"
With the ability to set the unit name,  this assumption is no longer true,
and if setting a long name (like "Frames" in #110540) the text overlaps the slider line

By right aligning the text on the left side of the slider, this overlap cannot happen anymore.

| Before | After |
| - | -  |
| ![image](/attachments/9d245773-3256-4ea7-a0b9-6b635956068d) | ![image](/attachments/2968c364-36ea-4d77-af0a-80499e72c8d8) |
| ![image](/attachments/31f13a7e-08f5-42bf-b687-b6ccc839f39d) | ![image](/attachments/6e9832e8-6644-493f-a791-e1b29718a0e4) |
| ![image](/attachments/7cabc3e2-585b-4725-8bde-f05aabb46e46) | ![image](/attachments/da5a4389-1cb1-422f-98b0-8881d8614356) |

Pull Request: #110586
6f3d396c5f LibOverride: Add ID pointer to operations over ID pointers.
In RNA collections storing ID references, the name of the collection
item may not always be unique, when several IDs from different libraries
are present.

While rare, this situation can become deadly to liboverride, by causing
random but exponential liboverride hierarchies corruptions.

This has already been alleviated by using preferably both name and index
in items lookup (a05419f18b) and by reducing the risk of name collision
in general between liboverrides and their linked reference (b9becc47de).

This commit goes further, by ensuring that references to items of RNA
collections of IDs stored in liboverride operations become completely
unambiguous. This is achieved by storing an extra pointer to the item's
ID itself, when relevant.

Lookup then requires a complete match `name + ID` to be successful,
which is guaranteed to match at most a single item in the whole RNA
collection (since RNA collection of IDs do not allow duplicates, and
the ID pointer is always unique).

Note that this ID pointer is implemented as an `std::optional` one
(either directly in C++ code, or using an new liboverride operation `flag`
in DNA). This allows to smoothly transition from existing data to the
added ID pointer info (when needed), without needing any dedicated
versioning. This solution also preserves forward compatibility as much
as possible.

It may also provide marginal performances improvements in some cases, as
looking up for ID items in RNA collections will first check for the
ID pointer, which should be faster than a string comparision.

Implements #110421.

Pull Request: #110773
e9dd3e637e GPv3 : Transform action for grease pencil frames.
Implementation of the transform action for grease pencil frames, which enables translating and scaling grease pencil frames in the dopesheet.

This patch adds the following in the grease pencil API :
 - `move_frames`  to move a set of frames given a map of key transformations (with overwrite), and
 -  the structure `LayerTransformData` that stores in the layer runtime some useful data for the frames transformation.

Co-authored-by: Falk David <falk@blender.org>
Pull Request: #110743
670fce0f20 Cleanup: reduce amount of math-related includes
Using ClangBuildAnalyzer on the whole Blender build, it was pointing
out that BLI_math.h is the heaviest "header hub" (i.e. non tiny file
that is included a lot).

However, there's very little (actually zero) source files in Blender
that need "all the math" (base, colors, vectors, matrices,
quaternions, intersection, interpolation, statistics, solvers and
time). A common use case is source files needing just vectors, or
just vectors & matrices, or just colors etc. Actually, 181 files
were including the whole math thing without needing it at all.

This change removes BLI_math.h completely, and instead in all the
places that need it, includes BLI_math_vector.h or BLI_math_color.h
and so on.

Change from that:
- BLI_math_color.h was included 1399 times -> now 408 (took 114.0sec
  to parse -> now 36.3sec)
- BLI_simd.h 1403 -> 418 (109.7sec -> 34.9sec).

Full rebuild of Blender (Apple M1, Xcode, RelWithDebInfo) is not
affected much (342sec -> 334sec). Most of benefit would be when
someone's changing BLI_simd.h or BLI_math_color.h or similar files,
that now there's 3x fewer files result in a recompile.

Pull Request #110944
2d3002bce3 GPv3: Display layer properties in animation channels
This patch adds layer widgets in the grease pencil layer channels of the grease pencil dopesheet.
It adds RNA + getter function for the `use_onion_skinning` at layer level.
It also sets the offset of the channel, and the color of grease pencil data-block channels.

Pull Request: #110991
db4d4afbfa Sim Nodes: Don't delete parent bake directory
The `OBJECT_OT_simulation_nodes_cache_delete` operator
would delete the parent bake directory. This could lead to catastrophic
loss of data if the user set their bake directory to a folder that
contains other files or folders.

This commit makes sure that only the "meta" and "bdata" folders get
deleted in the parent directory.

Pull Request: #110999
03563cde36 Nodes: move more geometry nodes rna code to node files
Continuation of f7c0ef1f73.
Only geometry nodes with inline (in function body) static enum array.

Pull Request: #111004
abaa63a52c MEM_guarded_alloc: Fix LSAN not reporting memory leaks.
The fact that the guarded-allocated memory blocks are all linked to the
static `membase` listbase is enough for LSAN to not detect them as
leaks.

So this commit adds a new (private) callback to clear the memlist, which
is only used in the destructor of the `MemLeakDetector` class.

Many thanks to @Sergey for identifying the root issue here.

Pull Request: #110995
e6b46632b0 Animation: Common curve drawing for FCurves
Before this patch, the drawing code iterated the FCurve to see if there are any
curve interpolation types that can't easily be drawn. (Sinusoidal, Bounce, etc)
If it found one, it would fall back to evaluating the FCurve.

That meant in the worst case scenario it would iterate the whole FCurve
before even starting to draw.

This PR unifies the drawing logic for FCurves no matter their interpolation type.
If it encounters a key type that it can't draw, it falls back to samples, but only
for the current key.

To clarify that it renames `draw_fcurve_curve_bezts` to `draw_fcurve_curve_keys`

Curves with modifiers are still drawn with samples.

## Performance
Test setup: 6000f of dense data on 62 bones.
Only measuring the average draw time **per curve**.
All measurements were done at the same zoom level.

| - | before | after |
| - | - | - |
| only beziers | 28μs | 13μs |
| only elastic | 90μs | 60μs |
| mix (~1/2 of the view with elastic) | 110μs | 24μs |

The performance boost with "only elastic" can be explained by the fact that per key I can skip 1 call to `evaluate_fcurve`.  That is because I always start at an existing keyframe so I can use its position.

Pull Request: #110764
099873d4ab Fix incorrect type cast of Outliner view layer element data
The view layer "base" element (the parent that the individual layers are
nested in) does not point to any data in its `directdata`, definitely
not to a view layer. Don't cast it to one, this can cause undefined
behavior when the pointer is not null.
8267ac0046 GPv3: Fix TreeNode::parent_group() for root group
For the root group, the parent is `nullptr` so calling `parent_group()`
would fail. This fixes the issue by adding a null check and returning
`nullptr` otherwise.
86a59fa406 Animation: Blend Offset Slider
Adds an operator to the Graph Editor that moves the selected
segment up/down so it aligns with the keys before/after the segment.

Co-authored-by: Ares Deveaux <aresdevo@gmail.com>
Co-authored-by: Sybren A. Stüvel <sybren@blender.org>
Pull Request: #110544
cb97eedf09 Refactor: Remove hack to store sequence type in Outliner tree element
`TreeElement.idcode` would be reused to store the sequence type. This is
risky if the field is assumed to actually contain a valid ID-code,
without further checks.
This was only accessed in one place, which I've refactored to a clean,
type-safe solution now.
f3b2f4c6d0 Refactor: Avoid unsafe cast for Outliner sequence elements
Relying on the `TreeStoreElem.id` void pointer makes assumptions about
what code elsewhere sets to it (it's also misleading since it's actually
not an ID pointer), in this case we can easily avoid that.
f458194d91 Fix #110464: rna_idprop_ui_create() fails to create new string property
The `BPy_IDPropertyUIManager` takes different keywords for different
data types in its `update` methods.
Booleans and Strings only handle defaults and description while Floats
and Ints can handle additional stuff like min/max.
(see `idprop_ui_data_update_string` vs. e.g.
`idprop_ui_data_update_float`)

There was a different code path in `rna_idprop_ui_create` for bools
already (only passing a subset to `update`), now use this for string as
well since it matches.

Bug introduced in 8b9a3b94fc.

Probably good for LTS.

Pull Request: #110935
5fb30aff34 UI: Allow passing empty string to templateID to ensure no label
This caused confusion when Bastien passed an empty string to the ID
template, expecting that it would ensure no default label is placed, but
it caused the layout to be split. This is because we'd still add an
empty label in this case.
e12b87c434 Fix incorrect parameter value passed to ID template
This argument is a boolean, not an icon. Value of both would be 0.
ce9f19a5c5 GPv3: Allow buttons for child nodes to be inactive
This makes it so that in the layer tree UI layers that have an
invisible parent will render their visibility icon as inactive (faded).
Same for the locked icon.
0fd767a76d GPv3: Fix: Assert hit when exiting paint mode
The function `ed_object_mode_generic_exit_ex` was missing
a case for the `OB_MODE_PAINT_GREASE_PENCIL`.
9aa95bbed3 Animation: Blend To Ease Slider
This PR blends the selected keyframes to an ease-in or ease-out curve.
The difference to the existing ease slider is that this one blends,
while the other snaps to the ease curve

Co-authored-by: Ares Deveaux <aresdevo@gmail.com>
Pull Request: #110566
be121b073d Fix #110971: Replace our own barely-working backtrace on memleaks feature with ASAN utils.
Instead of storing the backtrace in all memory blocks, and trying to get
meaningful info out of this list of pointers when printing leaked ones,
just use `__asan_describe_address` when ASAN is enabled.

This also work on Windows, in addition to linux and (presumably) OSX,
but does require to build with ASAN enabled.

The previous code was not working very well anymore, for some reason the
call to `backtrace_symbols` seems to fail to give any meaningful
information nowadays on most of Blender code. And it was only
implemented for linux and OSX.

Based on an idea from @LazyDodo, many thanks!

Pull Request: #111006
39aaafb506 Tweaks to previous commit affecting debug reports of our guarded allocator.
Somehow missed these tweaks (from @LazyDodo) in own recent 2e79ca3205
commit, sorry for the noise.
Almaz-Shinbay added 1 commit 2023-08-10 18:12:52 +02:00
Almaz-Shinbay requested review from Julian Eisel 2023-08-11 12:54:58 +02:00
Julian Eisel approved these changes 2023-08-11 14:51:48 +02:00
Julian Eisel merged commit d5c7608b39 into main 2023-08-11 14:52:16 +02:00
Almaz-Shinbay deleted branch temp-r-layer-refactor 2023-08-11 15:36:48 +02:00
Sign in to join this conversation.
No reviewers
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#110920
No description provided.