126825 Commits

Author SHA1 Message Date
Jeroen Bakker
72d3e43a3b Vulkan: Enable Draw Manager Test Cases
This PR enabled the draw manager test cases when compiling with
`WITH_VULKAN_BACKEND=On`. Currently they should pass all the tests
in draw_pass_test.cc that also pass for OpenGL. The draw_visibility
test seems to be faulty (also for OpenGL).

The vulkan backend doesn't have all the features implemented to
pass the Eevee testcases and are expected to fail.

Pull Request: https://projects.blender.org/blender/blender/pulls/110994
2023-08-10 21:41:52 +02:00
Jacques Lucke
048fa6480f Cleanup: quiet unused parameter warning 2023-08-10 21:41:17 +02:00
Jacques Lucke
7c0e2646f9 Nodes: move more rna code to node files
Continuation of f7c0ef1f733a252a055e3b4be3bb7de31dd091a5.

Pull Request: https://projects.blender.org/blender/blender/pulls/111000
2023-08-10 20:48:41 +02:00
Harley Acheson
c4fb34a3f7 Fix #110085: Ignore Scroller Zone when on a Screen Edge
When the mouse cursor is between editors ignore scroller zones, which
overflow their areas, so that screen edges are always detected.

Pull Request: https://projects.blender.org/blender/blender/pulls/110402
2023-08-10 20:41:44 +02:00
Brecht Van Lommel
11bca76f96 Cycles: update OSL to work with version 1.13.2
While keeping compatibility with older versions.

Ref #110708

Pull Request: https://projects.blender.org/blender/blender/pulls/110980
2023-08-10 20:01:09 +02:00
Julian Eisel
c19caff2dc Cleanup: Include layer tree element in assert check 2023-08-10 17:58:31 +02:00
Bastien Montagne
bcc0b9f73f 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.
2023-08-10 17:56:36 +02:00
Bastien Montagne
2e79ca3205 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: https://projects.blender.org/blender/blender/pulls/111006
2023-08-10 17:54:56 +02:00
Julian Eisel
a89c104972 Cleanup: Don't set unused ID code member for Outliner layer base element
This is one of the many ID elements that should be ignored from further
processing in this if-else block. It would only set the
`TreeElement.idcode` (and call an assert) for this, which wasn't used
elsewhere. We're trying to untangle the code step by step and make it
more clear & explicit which data is set where, changes like this help.
2023-08-10 17:54:01 +02:00
Christoph Lendenfeld
8ddb8e0d05 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: https://projects.blender.org/blender/blender/pulls/110566
2023-08-10 17:51:14 +02:00
Falk David
d14289c46a 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`.
2023-08-10 17:44:27 +02:00
Falk David
7e594b5d96 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.
2023-08-10 17:44:27 +02:00
Iliya Katueshenock
9f8535a498 Fix: bring back repeat input node rna declaration
Wrongly removed as part of 43667b807e03717cf6f28553012f9606b3661a5a

Pull Request: https://projects.blender.org/blender/blender/pulls/111014
2023-08-10 17:40:08 +02:00
Julian Eisel
4095e6a14c Fix incorrect parameter value passed to ID template
This argument is a boolean, not an icon. Value of both would be 0.
2023-08-10 17:13:02 +02:00
Julian Eisel
ff636ed092 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.
2023-08-10 17:12:18 +02:00
Philipp Oeser
dce2368b8c 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: https://projects.blender.org/blender/blender/pulls/110935
2023-08-10 16:54:35 +02:00
Julian Eisel
e2cd2236ca 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.
2023-08-10 16:51:50 +02:00
Julian Eisel
c0065979a1 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.
2023-08-10 16:51:29 +02:00
Christoph Lendenfeld
b56fc47eed Fix: Wrong property name and description 2023-08-10 16:33:44 +02:00
Christoph Lendenfeld
a0aa5480b1 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: https://projects.blender.org/blender/blender/pulls/110544
2023-08-10 16:09:39 +02:00
Falk David
4f66031714 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.
2023-08-10 16:05:21 +02:00
Julian Eisel
a995e16cd2 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.
2023-08-10 15:44:12 +02:00
Christoph Lendenfeld
255818a569 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: https://projects.blender.org/blender/blender/pulls/110764
2023-08-10 15:33:22 +02:00
Bastien Montagne
c5feb0cada 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: https://projects.blender.org/blender/blender/pulls/110995
2023-08-10 15:05:53 +02:00
Iliya Katueshenock
43667b807e Nodes: move more geometry nodes rna code to node files
Continuation of f7c0ef1f733a252a055e3b4be3bb7de31dd091a5.
Only geometry nodes with inline (in function body) static enum array.

Pull Request: https://projects.blender.org/blender/blender/pulls/111004
2023-08-10 14:57:01 +02:00
Falk David
101abc6f6c 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: https://projects.blender.org/blender/blender/pulls/110999
2023-08-10 14:29:32 +02:00
Amelie Fondevilla
f1e4cd3f1f Fix: missing include in volume.cc
Pull Request: https://projects.blender.org/blender/blender/pulls/111005
2023-08-10 14:21:22 +02:00
Amelie Fondevilla
7f6196ccae 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: https://projects.blender.org/blender/blender/pulls/110991
2023-08-10 13:55:14 +02:00
Aras Pranckevicius
d973355b3a 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
2023-08-10 14:51:40 +03:00
Amelie Fondevilla
09d2108bf5 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: https://projects.blender.org/blender/blender/pulls/110743
2023-08-10 12:57:32 +02:00
Bastien Montagne
6a86dd5f34 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: https://projects.blender.org/blender/blender/pulls/110773
2023-08-10 12:41:20 +02:00
Christoph Lendenfeld
e119089928 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: https://projects.blender.org/blender/blender/pulls/110586
2023-08-10 12:27:28 +02:00
Jeroen Bakker
1bbfa8c5d3 Fix: Compilation issue GCC13 with Vulkan
Has been reported by different developers that the Vulkan
backend doesn't compile on GCC13.

Pull Request: https://projects.blender.org/blender/blender/pulls/110992
2023-08-10 11:27:44 +02:00
Christoph Lendenfeld
598af45459 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: https://projects.blender.org/blender/blender/pulls/110790
2023-08-10 11:03:01 +02:00
Campbell Barton
10615e98bc Revert white-space edit from cc95c02a897e26b04d22f99c25af18789e0976d4 2023-08-10 17:45:38 +10:00
Campbell Barton
cc95c02a89 Fix building WITH_OPENGL_BACKEND=OFF 2023-08-10 17:40:24 +10:00
Campbell Barton
ea10e601fd Cleanup: use _get() suffix for GHOST/Wayland methods
Avoid variables shadowing methods for common names such as
scale & outputs.
2023-08-10 17:38:34 +10:00
Campbell Barton
23cd37de25 Cleanup: redundant checks 2023-08-10 17:11:24 +10:00
Campbell Barton
a087790938 Cleanup: declare ReadEWAData const in struct and callbacks 2023-08-10 16:02:53 +10:00
Campbell Barton
a52c904c7b 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.
2023-08-10 15:46:21 +10:00
Campbell Barton
5763993098 License Headers: use SPDX-FileCopyrightText 2023-08-10 15:16:58 +10:00
Ray Molenkamp
4ad63687cb CMake: fix windows build and warning
Missing underscore in platform/platform_win32.cmake
and a quote too many in macros.cmake
2023-08-09 21:47:19 -06:00
Campbell Barton
dfc7edfe72 Build: set the encoding in discover_nodes.py
The encoding is platform dependent, ensure utf-8 is always used.
2023-08-10 13:12:06 +10:00
Campbell Barton
735273f537 CMake: show WITH_HYDRA on first installation
Also disable OSL for lite builds, only makes a difference when cycles is
enabled for lite builds.
2023-08-10 12:37:54 +10:00
Campbell Barton
5e44b3c147 Fix error in recent refactor to add_check_c{xx}_compiler_flag functions
The variable needs to be set in the parents scope.
2023-08-10 12:17:49 +10:00
Campbell Barton
b057c0cce1 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]: 19912457c6e79a590d8435246d58656e2d69abd0
2023-08-10 11:57:30 +10:00
Campbell Barton
8cea7519ca Cleanup: wrap long lines in CMake 2023-08-10 11:28:25 +10:00
Campbell Barton
e95e6ad66a CMake: replace duplicate lines with a for loop 2023-08-10 11:28:23 +10:00
Campbell Barton
9dfb3fc550 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.
2023-08-10 11:28:22 +10:00
Campbell Barton
49064a96bc Cleanup: quiet warning on MSVC 2023-08-10 09:29:06 +10:00