Sculpt: Improve Expand performance #120125

Closed
Raul Fernandez Hernandez wants to merge 181 commits from farsthary/blender:improve-expand-perf into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.

181 Commits

Author SHA1 Message Date
126ade90bb Revert changes in tests/data directory 2024-04-22 07:10:36 -04:00
f452b2f886 optim 2024-04-21 23:31:25 -04:00
fc251c6174 fix 2024-04-21 23:07:21 -04:00
30048a74a8 expand in place experiment 2024-04-21 22:56:49 -04:00
f18c9ef9c9 wip 2024-04-21 14:04:37 -04:00
1999f90a5d wip 2024-04-17 13:38:13 -04:00
63364a9fef thread safety 2024-04-16 04:36:44 -04:00
c37451d47b feedback 2024-04-12 20:09:15 -04:00
b9f6ccf007 feedback 2024-04-12 16:42:31 -04:00
952c832894 nit pick 2024-04-12 16:00:07 -04:00
1da76ddb7b nit pick 2024-04-12 13:53:58 -04:00
1243ff743a nit 2024-04-12 11:00:42 -04:00
16bd4e7eef reset tests 2024-04-11 20:27:45 -04:00
820a331a66 Revert "Cleanup: use const EnumPropertyItem pointers"
This reverts commit 8cce0b5ef0.
2024-04-11 19:14:26 -04:00
f27c985acd Revert "Cleanup: pass const arrays for default boolean arguments"
This reverts commit bc2ada4746.
2024-04-11 19:14:24 -04:00
efc088aa94 Revert "Cleanup: remove redundant checks & struct declaration"
This reverts commit 45a11276f8.
2024-04-11 19:14:23 -04:00
5b1f4ae917 Revert "Cleanup: pass const arguments in freestyle functions"
This reverts commit f9cdf830ea.
2024-04-11 19:14:21 -04:00
3b7d7c6581 Revert "Cleanup: spelling in comments"
This reverts commit 5ce74df0ba.
2024-04-11 19:14:19 -04:00
6e9cc8bb50 Revert "Fix #120367: Attach to root panel if new parent is null"
This reverts commit aeb6b3e136.
2024-04-11 19:14:18 -04:00
afe1b1d3b1 Revert "Anim: add Animation data-block management functions"
This reverts commit 5ef9d0f51f.
2024-04-11 19:14:16 -04:00
34c0307967 Revert "Anim: allow assigning Animation data-blocks"
This reverts commit 65408d5c56.
2024-04-11 19:14:15 -04:00
5a5e4a2c99 Revert "Anim: Add a simple GUI for assigning Animation data-blocks"
This reverts commit e4b5cc9fb5.
2024-04-11 19:14:13 -04:00
56d1b41992 Revert "Anim: allow inserting keys in Animation data-block"
This reverts commit 4709b491ce.
2024-04-11 19:14:11 -04:00
f8716d95f1 Revert "Anim: add evaluation of Animation data-blocks"
This reverts commit 2c9b0be956.
2024-04-11 19:14:10 -04:00
1c871d4046 Revert "Anim: show animated properties with the appropriate color in the GUI"
This reverts commit 250a92b5d8.
2024-04-11 19:14:08 -04:00
59aff1b697 Revert "Cleanup: move runtime data to Library.runtime"
This reverts commit 5207259b96.
2024-04-11 19:14:06 -04:00
bdfcb9a43c Revert "Fix #120374: Knife crashes when displaying measurements"
This reverts commit bfdbede6a7.
2024-04-11 19:14:05 -04:00
829417b4e0 Revert "Cleanup: quiet missing-declarations warnings"
This reverts commit f303ed401f.
2024-04-11 19:14:03 -04:00
09060a3cb6 Revert "Fix #120071: quadratic complexity for dangling reroute check"
This reverts commit 963057f119.
2024-04-11 19:14:02 -04:00
6651728d9e Revert "Compositor: Allow inter-operation canceling"
This reverts commit deba511d3e.
2024-04-11 19:14:00 -04:00
f4aae007a7 Revert "Anim: change experimental flag label & linked issue on Gitea"
This reverts commit e91a110a5e.
2024-04-11 19:13:58 -04:00
e54e07fefc Revert "Anim: change label & description of experimental flag again"
This reverts commit c06f269425.
2024-04-11 19:13:55 -04:00
6434072258 Revert "Cycles: Adjust Meteor Lake GPUs architecture version"
This reverts commit 8649603b31.
2024-04-11 19:13:53 -04:00
fbc259c9d0 Revert "EEVEE-Next: Fix performance regression"
This reverts commit 804a04e8fd.
2024-04-11 19:13:51 -04:00
5e8b532ecf Revert "Collection Exporters: Enable file exporters to be specified on Collections"
This reverts commit 2774f9c650.
2024-04-11 19:13:49 -04:00
591ad09c7c Revert "Cleanup: quiet missing-declarations warnings"
This reverts commit 76a9db475d.
2024-04-11 19:13:47 -04:00
b3305f4728 Revert "Cleanup: remove redundant variables & assignments"
This reverts commit 3151b83bbb.
2024-04-11 19:13:46 -04:00
697d9f3534 Revert "Cleanup: promote to size_t before calculating sizes"
This reverts commit 8338f9e0ce.
2024-04-11 19:13:44 -04:00
d4d4907f8b Revert "Cleanup: avoid shadowing variables"
This reverts commit 072a56f356.
2024-04-11 19:13:43 -04:00
8d9c22226e Revert "Fix potential null pointer dereference from the RenderView::imbuf"
This reverts commit dc775e59df.
2024-04-11 19:13:41 -04:00
01670e5681 Revert "Anim: Detailed report if no keyframes have been inserted"
This reverts commit 3869a8c852.
2024-04-11 19:13:40 -04:00
03a0b5c74e Revert "Anim: thread remake_graph_transdata"
This reverts commit 3a9b7d076a.
2024-04-11 19:13:39 -04:00
36e63d81c8 Revert "BLI: IndexMask: Add binary set operations"
This reverts commit 81e2b7d7d5.
2024-04-11 19:13:37 -04:00
d87229d14e Revert "Fix #120144: Invert Visible doesn't invert Face Sets properly"
This reverts commit afa8fbfd8e.
2024-04-11 19:13:36 -04:00
ef3b7d206f Revert "Fix #119702: Set Position node behaves incorrectly on instances with selection"
This reverts commit ad66f1caa0.
2024-04-11 19:13:34 -04:00
b3266478d9 Revert "Realtime Compositor: Support variable scaling"
This reverts commit 85a04ad05a.
2024-04-11 19:13:32 -04:00
2f3c61dd4d Revert "Cycles: Properly default to Metal-RT off unless GPU is a M3 or newer"
This reverts commit 9dab4f319c.
2024-04-11 19:13:31 -04:00
a8d6a6098e Revert "Anim: Avoid loading alpha channel from theme for keyframe drawing"
This reverts commit ebb4ac7494.
2024-04-11 19:13:29 -04:00
d6cf5ef6df Revert "Fix #118509: GPv3: frames disappear during transform in the timeline"
This reverts commit bbb6b0e50f.
2024-04-11 19:13:28 -04:00
2c3788ff5d Revert "Anim: make CombinedKeyingResult plain old data"
This reverts commit db3ccf0bc3.
2024-04-11 19:13:26 -04:00
859edb1776 Revert "Fix #120436: "Show Fill Color" setting not working"
This reverts commit 78abe7d651.
2024-04-11 19:13:25 -04:00
d3a5c6c83c Revert "Fix: EEVEE-Next: Volume: Wrong voxelization from accurate method"
This reverts commit fbba8de3fd.
2024-04-11 19:13:23 -04:00
23bb566749 Revert "EEVEE-Next: Add back volume reprojection"
This reverts commit 49977bee1c.
2024-04-11 19:13:22 -04:00
13a87835b8 Revert "UI: Splash Screen Import Changes"
This reverts commit be8869949a.
2024-04-11 19:13:20 -04:00
ad2a6b47a6 Revert "UI: Removal of GRAPH_OT_keys_to_samples Confirmation"
This reverts commit b05d1ab52c.
2024-04-11 19:13:19 -04:00
e2c63b543b Revert "Fix #120443: Knife tool loses precision on edges with high clip distance range"
This reverts commit 3582319c4d.
2024-04-11 19:13:18 -04:00
f0f3068e76 Revert "Fix: Matrix socket is always visible"
This reverts commit 0e1c6c8c57.
2024-04-11 19:13:14 -04:00
70b8d3b0d5 Revert "Fix: Crash calculating edges of empty mesh"
This reverts commit 5f47ff5333.
2024-04-11 19:13:13 -04:00
8bece4be5b Revert "Cleanup: Use utility function to sample triangle bary coord"
This reverts commit b37bc24285.
2024-04-11 19:13:11 -04:00
ac723616e3 Revert "Fix #120400: Remove cyclic dependency of pbvh type when building bmesh pbvh"
This reverts commit 9e30209725.
2024-04-11 19:13:09 -04:00
f9a1a87f3c Revert "Cleanup: Make format"
This reverts commit 660a495fe2.
2024-04-11 19:13:07 -04:00
16a1ce88ef Revert "Fix crash using "--command" on Windows"
This reverts commit ebb2ca8055.
2024-04-11 19:13:05 -04:00
43ad1d6af7 Revert "Fix error accessing the add-on install "target" without a context"
This reverts commit 6e32f8836e.
2024-04-11 19:13:04 -04:00
64bb745c3d Revert "Cleanup: spelling in comments"
This reverts commit f4fd699f1f.
2024-04-11 19:13:02 -04:00
58c2cda42f Revert "Cleanup: remove type hints & f-strings from core scripts"
This reverts commit 72a4262a92.
2024-04-11 19:13:01 -04:00
dcca52b604 Revert "Cleanup: avoid redundant string formatting"
This reverts commit 80a082a3e3.
2024-04-11 19:12:59 -04:00
ac187d00ec Revert "Fix: GPv3: Clear copy strokes buffer if nothing is selected during copy"
This reverts commit 067c674818.
2024-04-11 19:12:56 -04:00
89846991dc Revert "Fix #120421: Animated "Burn metadata into image" ignored during render"
This reverts commit e9add526d1.
2024-04-11 19:12:55 -04:00
6e5d4edb0d Revert "GPv3: Deselect everything from all visible drawings when pasting strokes"
This reverts commit a1e1a6c346.
2024-04-11 19:12:53 -04:00
119fb11eea Revert "Fix #120459: GPv3: Issue in conversion for layer parents"
This reverts commit 8089f37be1.
2024-04-11 19:12:51 -04:00
58b784417b Revert "Curves: add operator to set bezier handle types"
This reverts commit 4bc86cfe83.
2024-04-11 19:12:50 -04:00
13144fec75 Revert "UI: Add Rename operator in bone collection context menu"
This reverts commit 6b23c321cd.
2024-04-11 19:12:48 -04:00
8abf77ef70 Revert "Cleanup: Make format"
This reverts commit b84818b018.
2024-04-11 19:12:46 -04:00
b5ac6cf670 Revert "Fix #120402: memory leak in volume grid handling"
This reverts commit 5aa16f5670.
2024-04-11 19:12:45 -04:00
14d9969835 Revert "Fix #120417: VSE crash rendering a scene strip with missing Editing data"
This reverts commit 9890e738a9.
2024-04-11 19:12:42 -04:00
c6fd8c0e00 Revert "BLI: Fix inverted 0 determinant for infinite orthographic projection"
This reverts commit c1534f6f18.
2024-04-11 19:12:40 -04:00
8c29fc0ae5 Revert "Fix #113182: Crash when animating Viewport visibility of Curves / GPv3 object"
This reverts commit ff496fcc11.
2024-04-11 19:12:35 -04:00
1e9cb4888f Revert "UI: Indicate type of search in keymap search button"
This reverts commit 8bda7c9036.
2024-04-11 19:12:32 -04:00
85de11e8b2 Revert "GHOST: add missing check for end full-screen failing"
This reverts commit 5ac7eb8c01.
2024-04-11 19:10:35 -04:00
bc28e737be Revert "Fix assert in the case of a null library_reference items"
This reverts commit ac88d0e5e7.
2024-04-11 19:10:20 -04:00
b249eaf152 Revert "cppcheck: suppress noisy output"
This reverts commit 3b0521976e.
2024-04-11 19:09:56 -04:00
a8d16ef143 feedback 2024-04-11 15:59:55 -04:00
8bda7c9036 UI: Indicate type of search in keymap search button
Shows either "Search by Name" or "Search by Key-Binding" as placeholder text in
the search button. This makes it more clear what's expected to be entered here.

Personally I often did/do the mistake of searching for the wrong thing in this
button, because I forgot that I changed it earlier. The placeholder text can
avoid this mistake.

Pull Request: #113681
2024-04-11 10:23:28 -04:00
ff496fcc11 Fix #113182: Crash when animating Viewport visibility of Curves / GPv3 object
This is actually a deeper issue, which roots to the fact that updating
relations of the dependency graph does not properly handle cases when an
operation was previously skipped from evaluation (i.e. as a visibility
optimization).

The fix is to preserve needs-update flag throughout relations update of
a dependency graph, similar to the entry tags.

Pull Request: #120477
2024-04-11 10:23:27 -04:00
c1534f6f18 BLI: Fix inverted 0 determinant for infinite orthographic projection
This was creating issues with triangle winding order since
the resulting matrix was degenerate (0 determinant). Which
caused the Draw manager to wrongly invert the winding.

This fixes a bug in EEVEE-Next mesh voxelization for volume
rendering (with accurate method).
2024-04-11 10:23:27 -04:00
9890e738a9 Fix #120417: VSE crash rendering a scene strip with missing Editing data
In case a scene strips `Input` was set to `Sequencer`, but the scene did
not actually have `Editing` data (e.g. when just adding a `New` scene as
scene strip), blender would crash trying to render.

Now simply check if the required `Editing` data is present before
proceeding.

Pull Request: #120418
2024-04-11 10:23:27 -04:00
5aa16f5670 Fix #120402: memory leak in volume grid handling
The openvdb tree was not freed correctly because the destuctor
of the `shared_ptr` was not run.
2024-04-11 10:23:27 -04:00
b84818b018 Cleanup: Make format 2024-04-11 10:23:27 -04:00
6b23c321cd UI: Add Rename operator in bone collection context menu
Operator to rename tree view item already exists: `UI_OT_view_item_rename`
Add this in context menu as discussed in !120003

Pull Request: #120086
2024-04-11 10:23:26 -04:00
4bc86cfe83 Curves: add operator to set bezier handle types
This adds an operator to set the handle types of bezier curves. It also
adds the same shortcut that is available in the legacy curve edit mode.

Pull Request: #120426
2024-04-11 10:23:26 -04:00
8089f37be1 Fix #120459: GPv3: Issue in conversion for layer parents
The layer parenting did not account for storing an
initial parent inverse matrix (to "keep transform").

This adds this matrix, stores it in DNA, and uses it
when we compute the parent matrices on demand.

Note: This PR does not set the parent inverse matrix
outside of conversion from GPv2. Support for
"keep transform" parenting will have to be added
in another PR.

Pull Request: #120462
2024-04-11 10:23:26 -04:00
a1e1a6c346 GPv3: Deselect everything from all visible drawings when pasting strokes
To match with gpv2 behavior, fill selection attribute of all the visible
drawings with "false" value to deselect them so only the pasted stroke
from the clipboard is selected.

Pull Request: #120363
2024-04-11 10:23:26 -04:00
e9add526d1 Fix #120421: Animated "Burn metadata into image" ignored during render
Seems like scene `RenderData` only gets synched once from `Scene` to
`BaseRender` in `RE_InitState` .
Animation on it is only evaluating on the scene, so the the `BaseRender`
`RenderData` is not properly updated here.

However `R_STAMP_DRAW` is part of that and it is the `BaseRender`
`RenderData` that is checked in `do_render_full_pipeline` (not the
`Scene` one) to determine if we want to stamp.

Later calls to `BKE_render_result_stamp_info` / `renderresult_stampinfo`
/ `stampdata` always get passed the scene, so individual animation stamp
details (such as Render Time) work properly.

So to resolve, use the `Scene` `RenderData` (rather than the
`BaseRender` one) for proper animation update.

NOTE: this (not updating animation of members of `RenderData`) might
actually be a problem elsewhere, too -- havent checked on this in detail
though

Pull Request: #120429
2024-04-11 10:23:26 -04:00
067c674818 Fix: GPv3: Clear copy strokes buffer if nothing is selected during copy
If `clipboard.curves` has some curve and the copy operation is called
again when nothing is selected, the buffer is expected to be cleared.
Otherwise the paste operations will paste the previous copied curves.

Pull Request: #120454
2024-04-11 10:23:25 -04:00
80a082a3e3 Cleanup: avoid redundant string formatting 2024-04-11 10:23:25 -04:00
72a4262a92 Cleanup: remove type hints & f-strings from core scripts
Follow conventions for core scripts.
2024-04-11 10:23:25 -04:00
f4fd699f1f Cleanup: spelling in comments 2024-04-11 10:23:25 -04:00
6e32f8836e Fix error accessing the add-on install "target" without a context
Introspecting the add-on install operator from operator cheat-sheet
raised a Python exception.
2024-04-11 10:23:25 -04:00
ebb2ca8055 Fix crash using "--command" on Windows
Use after free error accessing command line arguments on windows.
Resolve by duplicating the arguments when a "--command" is passed in.
2024-04-11 10:23:25 -04:00
660a495fe2 Cleanup: Make format 2024-04-11 10:23:24 -04:00
9e30209725 Fix #120400: Remove cyclic dependency of pbvh type when building bmesh pbvh
This PR fixes a crash when enabling Dyntopo.

When the PBVH generation code for BMesh was changed in b3aca5b28f, a
bug was introduced where dependent code to generate necessary layers
for BMesh could no longer access the PBVH type, as it was not generated
yet. As the type is known in the code at time of construction, I opted
to add parameters specifying the PBVHType to necessary methods when
accessing attributes.

Pull Request: #120445
2024-04-11 10:23:24 -04:00
b37bc24285 Cleanup: Use utility function to sample triangle bary coord
Also move the declaration of the BVH tree closer to its use.
2024-04-11 10:23:24 -04:00
5f47ff5333 Fix: Crash calculating edges of empty mesh
At some point (Fill Curve node in my case) it is possible to have
empty task of edges. Simplest fix - ignore such tasks. In future
this might be improved (see: #120224).

Pull Request: #120330
2024-04-11 10:23:24 -04:00
0e1c6c8c57 Fix: Matrix socket is always visible
Fix of typo in weakly typed API.

Pull Request: #120337
2024-04-11 10:23:24 -04:00
3582319c4d Fix #120443: Knife tool loses precision on edges with high clip distance range
The previous algorithm for interpolating the vertices of an edge using
a lambda in screen space was heavily dependent on the resolution of the
projection matrix, leading to precision loss when the clip distance
range was high.

The updated algorithm now adjusts the lambda according to the
perspective before performing the interpolation, which improves
precision regardless of the clip distance range.
2024-04-11 10:23:24 -04:00
b05d1ab52c UI: Removal of GRAPH_OT_keys_to_samples Confirmation
Removal of the dialog that pops up to confirm this operator. The
Animation & Rigging module feels this isn't needed since this action
is quite visual and hard to miss. This operator is also not often
used and might get removed in future as unnecessary.

Pull Request: #120074
2024-04-11 10:23:23 -04:00
be8869949a UI: Splash Screen Import Changes
Removal of "What's New" button, addition of a section divider, and many
very small changes to the text, some reordering of items.

Pull Request: #118224
2024-04-11 10:23:23 -04:00
49977bee1c EEVEE-Next: Add back volume reprojection
This is done almost the same as legacy EEVEE.

The main difference is that we now take into
account the change in volume Z bounds during
reprojection.

The viewport smoothing experience as also be
improved with less blurring when moving
objects.

We also still do the reprojection during
final rendering between samples. This improves
the convergence as the input to the film TAA
is less noisy.

Pull Request: #120320
2024-04-11 10:23:23 -04:00
fbba8de3fd Fix: EEVEE-Next: Volume: Wrong voxelization from accurate method 2024-04-11 10:23:23 -04:00
78abe7d651 Fix #120436: "Show Fill Color" setting not working
The flag was completly unused in the code.
Now this flag does what it says: While drawing,
the fill color is (almost) not visible.

Pull Request: #120438
2024-04-11 10:23:23 -04:00
db3ccf0bc3 Anim: make CombinedKeyingResult plain old data
The data in CombinedKeyingResult was using BLI's Array type, which
heap allocates.  However, we know the array size at compile time,
and therefore can use std::array instead, as suggested in Array's
documentation.  This makes CombinedKeyingResult a
plain-old-data class.

Pull Request: #120425
2024-04-11 10:23:23 -04:00
bbb6b0e50f Fix #118509: GPv3: frames disappear during transform in the timeline
While selecting and transforming multiple grease pencil frames in the
timeline, frames would sometimes disappear. This happened when the
transformation overlapped, meaning when a frame replaced another moving
one in the timeline. The frames transformation was happening in place
and in series, and thus leaded to the initial position of the frame to
be removed, even if it was occupied by a freshly transformed framed.

This commit fixes the issue by storing two separate maps in the
transform data structure instead of one, one map to store the static
data, meaning the frames that are not affected by the transform, and
another one for the moving data, meaning the frames that are affected by
the transform.

Some changes were made to account for the potential duplication of the
frames (move + duplicate):
* the map of the duplicated frames was renamed to a more explicit name,
* when a duplication occurs, the original frame is stored in the static
  frames map, and the duplicate is stored in the moving frames map,
* thus the check for the duplicate flag of the operator is now done at
  the init step of the transform, instead of the update step, so that
  the maps are initialized accordingly.

Co-authored-by: Lukas Tönne <lukas@blender.org>
Pull Request: #119337
2024-04-11 10:23:22 -04:00
ebb4ac7494 Anim: Avoid loading alpha channel from theme for keyframe drawing
The theme has a color for each keyframe type. This is exposed in RNA and
the preferences UI as an RGB color, so without alpha channel. The code
that loads the color from the theme, however, does include that
unsettable alpha channel, though.

In practice this doesn't cause issues, as the versioning code ensures
that the default colors are stored with `alpha=uint8_t(255)`. While
developing, however, this caused me considerable headscratching, as I
was missing that little bit of versioning code, which means that the
default color was set to all-zeroes, and thus had a zero alpha.

This is now resolved by altering the drawing code to only load the RGB
component from the theme. This way only the user-settable bytes are
loaded, while the alpha component is handled a different way (setting it
to an absolute value, instead of multiplying the theme value).

No user-perceivable changes, just some developer comfort.

Pull Request: #120311
2024-04-11 10:23:22 -04:00
9dab4f319c Cycles: Properly default to Metal-RT off unless GPU is a M3 or newer
Ever since commit [1], `use_metalrt_by_default` will be True
if the GPU being used is not a M1 or M2 based system.
The intention of this was to enable MetalRT by default for
M3 and newer devices that have hardware for ray traversal.

However the side effect of this change was that all AMD GPUs would
have `use_metalrt_by_default` set to True. Which appears to be the
main culprit causing crashes on older AMD GPUs in #120126.
Since these GPUs don't support MetalRT.

This commit fixes this issue by only setting
`use_metalrt_by_default` to True if the GPU is not M1 or M2 based,
and the GPU is Apple Silicon based. Which equates to M3 or newer.
Which is the original intent of this code.

This resolves the issue where AMD GPUs were being told to use MetalRT
by default, when they shouldn't be.

[1] 322a2f7b12

Pull Request: #120299
2024-04-11 10:23:22 -04:00
85a04ad05a Realtime Compositor: Support variable scaling
This patch adds support for variable scaling in the Scale node for the
Realtime Compositor. This is supported for the CPU compositor.

Pull Request: #120314
2024-04-11 10:23:22 -04:00
ad66f1caa0 Fix #119702: Set Position node behaves incorrectly on instances with selection
The selection was not taken into account properly and uninitialized data was used.

Pull Request: #120409
2024-04-11 10:23:22 -04:00
afa8fbfd8e Fix #120144: Invert Visible doesn't invert Face Sets properly
Caused by 53418fc3a1.
corner vertices of hidden face sets are not `1/true/hidden` (which
is expected). So inverting then hides these corner verts, hence the
small region of face sets is visible afterwards.
This could be avoided if `.hide_poly` attribute is used for changing the
visibility.

Pull Request: #120160
2024-04-11 10:23:22 -04:00
81e2b7d7d5 BLI: IndexMask: Add binary set operations
The `IndexMask` class already had a static function `from_union`.
This adds two new functions `from_difference` and `from_intersection`
as well as tests for each of them.

It also uses `from_intersection` in two grease pencil utility functions.

Pull Request: #120419
2024-04-11 10:23:21 -04:00
3a9b7d076a Anim: thread remake_graph_transdata
On animations with high key counts, `remake_graph_transdata`
takes most of the compute time when moving keys.
This patch threads the loop over FCurves in that function to speed things up.

Test file with 10.000 keys per F-Curve
| - | Before | After |
| - | - | - |
| Moving 1 key of each FCurve |  ~2200ms | ~285ms |
| Moving a single key | ~0.70ms | ~0.72ms |

As demonstrated in the measurements, this speeds up the
case of modifying a lot of data, while not impacting the case
of modifying very little data.
The measurements were taken on an 8c/16t CPU.
The higher the thread count, the better the performance gain.

Measurements of `remake_graph_transdata` using the following test file.
https://download.blender.org/ftp/sybren/animation-rigging/heavy_mocap_test.blend

Pull Request: #119497
2024-04-11 10:23:21 -04:00
3869a8c852 Anim: Detailed report if no keyframes have been inserted
With this PR, when pressing `I` in the viewport and the code
is unable to insert **ANY** keyframes, the user will be presented
with a single message detailing exactly why it has failed.

This PR promotes the functionality introduced in
#117449 into the header file so it can be used elsewhere.

The `CombinedKeyingResult` class is returned
from `insert_key_action` and `insert_key_rna`, and
used to produce a single report from the operator if it
failed to insert any keyframes.

In order to easily create a report from a `CombinedKeyingResult`
the function `generate_keyframe_reports_from_result`
has been moved into the class as `generate_reports`.

In addition to that the `UNABLE_TO_INSERT_TO_NLA_STACK` result
has been added. This notifies the user if keyframe insertion is not
possible due to NLA stack settings.

Pull Request: #119201
2024-04-11 10:23:21 -04:00
dc775e59df Fix potential null pointer dereference from the RenderView::imbuf
This member is checked for null elsewhere, account for a null imbuf
when accessing pixels too.
2024-04-11 10:23:21 -04:00
072a56f356 Cleanup: avoid shadowing variables 2024-04-11 10:23:21 -04:00
8338f9e0ce Cleanup: promote to size_t before calculating sizes
Avoids integer truncation although it's mostly theoretical in this case.
2024-04-11 10:23:20 -04:00
3151b83bbb Cleanup: remove redundant variables & assignments
Co-authored-by: Sean Kim <SeanCTKim@protonmail.com>
2024-04-11 10:23:20 -04:00
76a9db475d Cleanup: quiet missing-declarations warnings 2024-04-11 10:23:20 -04:00
2774f9c650 Collection Exporters: Enable file exporters to be specified on Collections
This implements the ability to have file exporters added and configured on Collections.

Exporting is reachable from several locations:
- Individually on each exporter configuration: The `Export` button in each panel header
- For all exporters on the collection: The `Export All` button in the main panel interface
- For all exporters on all collections in the scene: The `File`->`Export All Collections` button

Visibility of which collections currently have exporters configured is done by ways of an icon added to the Collection row in the Outliner.

Adding multiple exporters for the same file type is permitted. The user is free to setup several exports of the same format but with different file locations or settings etc.

Notes:
Only USD and Wavefront OBJ are enabled for the initial commit. Additional formats, including those implemented in Python will be added as separate commits after this.

Ref #115690
Pull Request: #116646
2024-04-11 10:23:20 -04:00
804a04e8fd EEVEE-Next: Fix performance regression
The SAFE_UNION_ACCESS is always defined.
The correct check is to test for its value.

Fix DATA_MEMBER declaration too.
2024-04-11 10:23:20 -04:00
8649603b31 Cycles: Adjust Meteor Lake GPUs architecture version
Released devices are 12.70.4 or higher, there is no need to build for
12.70.0.
2024-04-11 10:23:20 -04:00
c06f269425 Anim: change label & description of experimental flag again
Change the experimental flag "New Animation System" to "New Animation
Data-block", as that's really what it is about. The tooltip is now also
more precise about what this experimental stage is about.
2024-04-11 10:23:20 -04:00
e91a110a5e Anim: change experimental flag label & linked issue on Gitea
Changed the experimental flag label from "Animation: Project Baklava" to
"New Animation System" to be more self-explanatory. Also I changed the
associated item on project.blender.org to #120406, which tracks the work
that is still to be done.
2024-04-11 10:23:19 -04:00
deba511d3e Compositor: Allow inter-operation canceling
This patch adds support for inter-operation canceling. Though it should
be noted that canceling will actually not take place except in certain
circumstances because operations are already submitted to the GPU by
this point and can't be canceled.

However, for operations that do CPU<->GPU transfers, like OIDN denoise,
which is one of the most expensive operations, this will actually cancel
the evaluation and greatly improve interactivity.

Pull Request: #119917
2024-04-11 10:23:19 -04:00
963057f119 Fix #120071: quadratic complexity for dangling reroute check
To know if link is connected to dangling reroute and can be skipped
as value-less, we need to know if reroute is dangling. This requires
graph traversal. Currently this is done by non-recursive iteration.
But this can lead quadratic complexity for some of the cases.
Other way is to make this linear while cache building.

Pull Request: #120375
2024-04-11 10:23:19 -04:00
f303ed401f Cleanup: quiet missing-declarations warnings 2024-04-11 10:23:19 -04:00
bfdbede6a7 Fix #120374: Knife crashes when displaying measurements
Caused by 7ed02da2be.
`curr.ob_index` is -1 when the ray does not hit any face
(`knife_find_closest_face`). This will lead to crash when mouse
is not over any faces. To avoid crash, use `bvh.ob_index`.

Pull Request: #120392
2024-04-11 10:23:19 -04:00
5207259b96 Cleanup: move runtime data to Library.runtime
Having a better separation between runtime and non-runtime data makes
it easier to reason about the code.

Pull Request: #120271
2024-04-11 10:23:18 -04:00
250a92b5d8 Anim: show animated properties with the appropriate color in the GUI
Use the `Animation` data-block to find F-Curves, for drawing the
background color of properties in the GUI (green for 'animated', yellow
for 'keyed on this frame', etc.).

This assumes (correctly) that the `Animation` is limited to a single
layer with a single strip. As such, there is only one set of F-Curves
for every animated ID, which means that the correct F-Curve will be
found. This will need adjustment when the same property can have
multiple F-Curves (due to layers) or when an F-Curve may not be
applicable for each point in time (due to the use of finite strips).

Pull Request: #118677
2024-04-11 10:23:18 -04:00
2c9b0be956 Anim: add evaluation of Animation data-blocks
Include Animation data-block handling in Blender's animation evaluation
stack. If an `Animation` is assigned to an `ID`, it will take precedence
over the NLA and/or any `Action` that might be assigned as well.

For more info, see #113594.

Pull Request: #118677
2024-04-11 10:23:18 -04:00
4709b491ce Anim: allow inserting keys in Animation data-block
Allow inserting keys into Keyframe strips (which is the only type of
strip that is currently implemented).

Note that the data model is currently limited to a single layer, with a
single infinite strip. Because of this, the strip will not be shown in
any UI, as there is no way to manipulate it anyway.

Note that the inserted keys are not yet evaluated, so the animation
isn't visible in the 3D viewport yet. That's for an upcoming commit.

For more info, see #113594.

Pull Request: #118677
2024-04-11 10:23:18 -04:00
e4b5cc9fb5 Anim: Add a simple GUI for assigning Animation data-blocks
Add a 'Baklava' panel to the 3D Viewport side-panel. It's a
developer-GUI, not meant for animators (or for inclusion beyond the
experimental feature, for that matter).

Note that this GUI shows all layer properties, even though the data
model is currently limited to a single layer. This means that things
like 'influence' and 'mix mode' are irrelevant, as there is no
underlying layer to mix with.

Also key insertion and animation evaluation are not implemented yet (but
will be in upcoming commits).

For more info, see #113594.

Pull Request: #118677
2024-04-11 10:23:18 -04:00
65408d5c56 Anim: allow assigning Animation data-blocks
Expand the `AnimData` struct with an `Animation *` + an
`binding_stable_index` field, and properly handle those relations.

This also adds functionality for actually pointing animated IDs to
`Animation` data-blocks, and automatically hooking up the relevant
`Binding`.

The Depsgraph code is extended to take these new relations into account,
but doesn't trigger any animation evaluation yet.

For more info, see #113594.

Pull Request: #118677
2024-04-11 10:23:17 -04:00
5ef9d0f51f Anim: add Animation data-block management functions
Add code (including RNA wrappers) for:

- Creating, removing, and accessing `Animation` data-blocks.
- Creating and removing layers, strips, and bindings on those `Animation`
  data-blocks.
- Accessing those via RNA.

Note that this does not include assignment to any animated data-block,
so it is of limited practical use.

For more info, see #113594.

Pull Request: #118677
2024-04-11 10:23:17 -04:00
aeb6b3e136 Fix #120367: Attach to root panel if new parent is null
If pointer to new parent is null, use pointer to root panel of interface.

Pull Request: #120369
2024-04-11 10:23:17 -04:00
5ce74df0ba Cleanup: spelling in comments 2024-04-11 10:23:17 -04:00
f9cdf830ea Cleanup: pass const arguments in freestyle functions
Also move implementation notes into the funciton body.
2024-04-11 10:23:16 -04:00
45a11276f8 Cleanup: remove redundant checks & struct declaration 2024-04-11 10:23:16 -04:00
bc2ada4746 Cleanup: pass const arrays for default boolean arguments 2024-04-11 10:23:16 -04:00
8cce0b5ef0 Cleanup: use const EnumPropertyItem pointers 2024-04-11 10:23:15 -04:00
5ac7eb8c01 GHOST: add missing check for end full-screen failing 2024-04-11 10:23:15 -04:00
ac88d0e5e7 Fix assert in the case of a null library_reference items
Missing return allowed a null return (which asserts) & ignored the
r_free assignment.
2024-04-11 10:23:14 -04:00
3b0521976e cppcheck: suppress noisy output
Some of these could be enabled if there is an interest to consider
them warnings, until then they're noisy and don't often hint at errors
in the code.
2024-04-11 10:23:14 -04:00
9537422dc1 repleace tbb 2024-04-08 11:55:45 -04:00
063711c2f1 Merge branch 'main' into improve-expand-perf 2024-04-07 21:59:12 -04:00
160faa37b8 comment 2024-04-05 09:28:00 -04:00
480b5dfe57 nit 2024-04-04 22:22:36 -04:00
4f8712a0c4 nit 2024-04-04 22:20:17 -04:00
cf8a908513 cleanup 2024-04-04 22:09:18 -04:00
620071716a wait free, lock free BFS 2024-04-04 19:19:44 -04:00
6c7d2cb02e Merge branch 'main' into improve-expand-perf 2024-04-04 16:04:35 -04:00
f1ed7ac4ae samll cleanup 2024-04-03 22:29:56 -04:00
41e041a266 cleanup 2024-04-03 19:26:00 -04:00
d681aa9f5a more wip 2024-04-01 16:35:38 -04:00
0402a16a9c concurrent writting experiments 2024-04-01 14:50:45 -04:00
2fbc863cfc simplification 2024-03-31 21:23:55 -04:00
cd0f89c36a wip 2024-03-31 20:55:10 -04:00
3e3eda1cfb cleanup 2024-03-31 16:49:47 -04:00
4bee64f9b2 Merge branch 'main' into improve-expand-perf 2024-03-31 16:08:22 -04:00
a91845fdc0 temporal 2024-03-31 16:07:02 -04:00
60f9f752ba wip 2024-03-31 09:57:15 -04:00
bf91c0b540 wip 2024-03-30 14:46:17 -04:00
646b2acc38 parial threading conversion 2024-03-30 00:39:47 -04:00
048dbd504a unnesting code 2024-03-29 19:42:46 -04:00
826a7de2ba wip 2024-03-29 16:56:06 -04:00
9523077ee7 wip 2024-03-29 16:14:55 -04:00
a05832207f improved parallel BFS 2024-03-27 17:17:04 -04:00
4f97cd736b wip 2024-03-27 16:35:05 -04:00
a63020f760 Merge branch 'main' into improve-expand-perf 2024-03-27 11:36:36 -04:00
ab89afd245 wip 2024-03-27 11:24:43 -04:00
a2cf59887f wip 2024-03-25 11:04:45 -04:00
62b8e560ec optimized expand sperical falloff 2024-03-24 04:40:22 -04:00
9ec6d03313 wip 2024-03-22 16:33:49 -04:00
777c13403b profiling 2024-03-22 14:59:21 -04:00