Commit Graph

133626 Commits

Author SHA1 Message Date
Campbell Barton
a972988a20 Merge branch 'blender-v4.1-release' 2024-03-01 09:30:26 +11:00
Campbell Barton
f4cc984038 Fix #116844: Transform -> Move shows mouse button shortcut
The order key-maps are stored changed in [0], causing the mouse button
shortcut to be shown instead of the "G" key.

[0]: d7558a243c6b3b48669d7c084ff0cfbbc5324e6a
2024-03-01 09:22:02 +11:00
Campbell Barton
d012a46605 Merge branch 'blender-v4.1-release' 2024-03-01 09:12:23 +11:00
Campbell Barton
fc6975e218 Unbreak build with WITH_IMAGE_OPENEXR disabled on macOS/ARM
[0] was meant to resolve this but the include is still needed event
when OPENEXR is disabled.

[0]: a39c16270ce5c39ead9aa2eee4e9c1cc99071f2e
2024-03-01 09:08:14 +11:00
Hans Goudey
b9fb51eaed Cleanup: Make format 2024-02-29 14:27:47 -05:00
Clément Foucault
90e86ead24 EEVEE-Next: Avoid same multiplication to the same constant 2024-02-29 19:19:10 +01:00
Raul Fernandez
c9bddce79b Cleanup: Grammar in comment
Comment's wording improvement

Pull Request: https://projects.blender.org/blender/blender/pulls/118913
2024-02-29 18:52:29 +01:00
Jesse Yurkovich
2353fd8f91 Alembic: Alleviate long loading times in large files
Sort the incoming Alembic objects by name before processing them. This
mirrors what is already done in USD to partially side-step Blender's
quadratic behavior when checking object names.

The file contained in issue #118839 contains over 365000 individual
objects. This change allows loading to be ~4x faster; from 2.2 hours
down to 28 minutes.

Additionally, change the progress bar to report in finer-grained steps
to better indicate that progress is still being made.

Pull Request: https://projects.blender.org/blender/blender/pulls/118869
2024-02-29 18:30:24 +01:00
Iliya Katueshenock
fd207d9b29 Fix #118883: Face Corner component shows in Delete Geometry node
Pull Request: https://projects.blender.org/blender/blender/pulls/118917
2024-02-29 18:01:08 +01:00
Brecht Van Lommel
6788b7e87f Merge branch 'blender-v4.1-release' 2024-02-29 17:55:37 +01:00
Julian Eisel
0876f58171 Assets: Increase thread safety when rebuilding "All" library
Note that this still isn't entirely thread safe since the catalogs of
the asset libraries may still be edited in various ways while building
the all asset library. But at least this avoids a data race when
assigning the catalog service once done building it.
2024-02-29 17:49:04 +01:00
Julian Eisel
9178ff244f Cleanup: remove 'this' keyword where guidelines don't ask for it
4cc1c65272 made this a protected member, so following the C++ style
guidelines, this doesn't have to use `this` for accessing.
2024-02-29 17:43:16 +01:00
Julian Eisel
5bc9434893 Refactor: Make asset catalog class members constant
Some of these members are not expected to change throughout the lifetime
of the class instances, so make them constant and only set them via the
constructor. Making them immutable this way helps making clear which
data needs extra attention for thread safety.
2024-02-29 17:33:18 +01:00
Brecht Van Lommel
36c11ee482 Fix #118514: Cycles MetalRT crash with empty scene
Pull Request: https://projects.blender.org/blender/blender/pulls/118907
2024-02-29 17:28:13 +01:00
Sergey Sharybin
d5bd5415ec Compositor: Enable lock-free GPU context activation on Windows
Pull Request: https://projects.blender.org/blender/blender/pulls/118909
2024-02-29 17:22:08 +01:00
Jacques Lucke
0e8e219d71 Undo: support implicit-sharing in memfile undo step
This adds implicit sharing support for the `MemFile` undo-step. This decreases memory
usage and increases performance.

Implicit sharing allows the undo system to take (shared) ownership of some data.
Previously, the data would always be serialized and compared to the previous undo-step.
So this turns an O(n) operation into O(1) (in terms of memory usage and time).

Read/write code that wants to make use of this has to use the new `BLO_read_shared`
and `BLO_write_shared` functions respectively. Those either make use of implicit-sharing
internally or do the "full" read/write based on a passed-in function. It seems possible to
use the same API in the future to store shared data to .blend files.

Improvements:
* Much faster undo step creation in many cases by avoiding the majority data copies
  and equality checks. This fixes #98574. I found undo step creation and undo step
  decoding to be 2-5 times faster in some demo files from the blender website and in
  some production files from the Heist project.
* Reduced memory usage when there is large data in `bmain`. For example, when
  loading the same highly subdivided mesh that I used in #106228 the memory usage
  is 1.03 GB now (compared to 1.62 GB in `main` currently). The main remaining copy
  of the data now is done by rendering code.
* Some significant performance improvements were also measured for the new grease
  pencil type (#105540).

There is one main downside of using implicit-sharing as implemented here: `MemFile`
undo steps can't be written as .blend files anymore. This has a few consequences:
* Auto-save becomes slower (up to 3x), because it can't just save the previous undo step
  anymore and does a normal save instead. This has been discussed in more detail here:
  https://devtalk.blender.org/t/remove-support-for-saving-memfile-undo-steps-as-blend-files-proposal/33544
  It would be nice to work towards asynchronous auto-save to alleviate this problem.
  Some previous work has been done to reduce the impact of this change in 41b10424c7e0
  and f0f304e240. This has been committed separately in efb511a76d98a.
* Writing `quit.blend` has to do a normal file save now. So it's a bit slower too, but it's
  less of a problem in practice.
* The `USE_WRITE_CRASH_BLEND` functionality does not work anymore. It doesn't seem
  to be used by anyone (removed in e90f5d03c4a382)

There are also benefits to not writing `MemFile` from undo steps to disk. It allows us to
more safely do undo-specific optimizations without risking corrupted .blend files. This
is especially useful when we want to preserve forward compatibility in some cases.
This requires converting data before writing the .blend files, but this conversion is not
necessary for undo steps. Trying to implement this kind of optimization in the past has
often lead to bugs (e.g. 43b37fbc93).

Another new problem is that it is harder to know the size of each undo step. Currently, a
heuristic is used to approximate the memory usage, but better solutions could be found
if necessary.

Pull Request: https://projects.blender.org/blender/blender/pulls/106903
2024-02-29 17:14:58 +01:00
Julian Eisel
e6642cd99c Refactor: Remove asset catalog helper classes from public header
These shouldn't need to be accessed from outside the asset system
itself, so they should not be exposed with its API. Move them to an own
asset system private headers. This is a further step towards making
asset system classes more encapuslated, so behavior and data flow can be
controlled better (which helps addressing threat safety issues).
Personally I've found it quite confusing to work on higher level issues
of the asset catalog system, because I got lost in the multiple classes.
Hopefully separating them more clearly helps with that too.
2024-02-29 17:12:08 +01:00
Julian Eisel
4cc1c65272 Refactor: Make asset catalog service non-public, access through API
Making the member private (or at least protected) makes threat safety
more tangible, and we don't need to expose locking in the API. Generally
we need to make data more encapsulated, so we can make edits more
controlled and threat safe.

Asset libraries also always have a catalog-service, so it can accessed
by reference, rather than pointer that would have to be null-checked.
2024-02-29 17:12:08 +01:00
Jacques Lucke
efb511a76d Core: remove support for writing MemFile undo steps as .blend files
In many modes, Blender uses the `MemFile` undo step, which serializes all DNA
data in RAM almost as if writing a .blend file. For auto-save, Blender used to
write the last `MemFile` undo step to disk because that was faster serializing
all of DNA again. Furthermore, saving the `quit.blend` file when closing Blender
also used this.

This functionality is now removed in preparate for supporting implicit sharing
in the undo system (#106903). Auto-save and saving the quit.blend file now use
regular file saving.

The removal of this feature and its implications have also been discussed here:
https://devtalk.blender.org/t/remove-support-for-saving-memfile-undo-steps-as-blend-files-proposal/33544
2024-02-29 17:04:44 +01:00
Jacques Lucke
e90f5d03c4 Core: remove support for writing crash.blend file
This was a debug feature for developers that allowed writing the last MemFile
undo step as a .blend file when Blender crashed. This was rarely/never used
nowadays and is now removed.

This is in preparation for #106903 which removes support for writing `MemFile`
undo steps as .blend files.
2024-02-29 17:04:44 +01:00
Miguel Pozo
3090a0a7f8 Fix: EEVEE-Next: Metal shader compilation
Metal doesn't support non-square matrices.

Pull Request: https://projects.blender.org/blender/blender/pulls/118912
2024-02-29 17:02:03 +01:00
Hans Goudey
a2726a3d7f Fix: Use after free in set position node
Alternative to #118820 and #118815.

The current optimization to skip work when the offsets are zero
or the positions are the original positions is error prone and overly
specific. Such optimizations should be applied to field evaluation
and attribute capturing in general.

This PR significantly simplifies the set position node to compose
fields with the addition function instead of implementing it directly
in the node. Then the position is saved to the geometry with the
generic utility for capturing attributes on geometry.

The most significant lost optimization is for when the positions are
original and the offset is zero. That could still be added back here
directly if we wanted. Or it could be done later in a more general
way that would also help in other places.

Pull Request: https://projects.blender.org/blender/blender/pulls/118857
2024-02-29 16:50:29 +01:00
Jacques Lucke
0a430fb8cb Geometry: speedup reverse UV sampler
This implements a new internal data structure for reverse uv sampling.
Being better than the previous one was not particularly hard, because it
was never really optimized and used a very simple approach. I found the
new implementation to be about 10-20x faster in my tests. Simon was
able to reproduce an comparable speedups in production files.

The speed-up is mainly achieved by a better memory layout and better
multi-threading during construction. The lookup performance is mostly the
same as before.

Like the old data structure, the new one also splits the uv space into
uniformly sized cells.  The size of the cells is based on the number of
triangles. Then it sorts all triangles into the rows that they touch. Finally,
it creates a flat array for each row that contains the triangle indices
contained in each cell.

There are still ways to optimize this further, but for now this is a good
improvement already.

Pull Request: https://projects.blender.org/blender/blender/pulls/118772
2024-02-29 16:42:36 +01:00
Jeroen Bakker
3a4220001b EEVEE-Next: Refresh when resizing area light via gizmo
When using the area light gizmo in the 3d viewport to resize the
area light, the changes where only made visible when EEVEE-Next would
rerender. EEVEE and Cycles did refresh accordingly.

The reason is that EEVEE and Cycles uses a more general approach of
detecting changes. EEVEE-Next listens to exact changes made in the
dependency graph.

This change fixes this by tagging the lamp without any flags similar
to what RNA does. EEVEE and Cycles don't need the general flag for
correct working.

Pull Request: https://projects.blender.org/blender/blender/pulls/118888
2024-02-29 16:12:01 +01:00
YimingWu
3dc483982c GPv2: LineArt: Conversion code
Adds conversion code for the lineart modifier for Grease Pencil 3.

Pull Request: https://projects.blender.org/blender/blender/pulls/118791
2024-02-29 16:02:44 +01:00
Miguel Pozo
4083f8004d EEVEE-Next: Add Shadows PCF
Add percentage closer filtering to shadowmap sampling and a
`shadow_filter_radius` property to lights to control it.

Notes:
* This adds PCF to `eevee_shadow_tracing_lib`, but not to
  `eevee_shadow_lib`, which is used by volumes (not required) and
  thickness.
* PCF is computed based on the LOD0 size. This assumes that higher
  LODs are only used when the shadowmap resolution is actually good
  enough to match the render resolution.

Pull Request: https://projects.blender.org/blender/blender/pulls/118220
2024-02-29 15:47:16 +01:00
Miguel Pozo
5f838bd5c5 Fix: EEVEE-Next: Shadow tile update tagging
Tiles tagged for update in eevee_shadow_tag_update_comp can be
untagged in eevee_shadow_tilemap_init_comp, since those tiles
might be tagged as rendered.
Regression from 9e015f703c
2024-02-29 15:36:02 +01:00
Falk David
f872520025 Fix: Curves: Crash in resample_to_count
The `std::all_of` function wasn't used correcty.
Also, the last value of `dst_offsets` was always 0
(because the offsets were still counts at this point)
so the fix also makes sure the last value
is never included in the check.
2024-02-29 15:08:42 +01:00
Jacques Lucke
8b3af6a68c Cleanup: make format 2024-02-29 14:22:33 +01:00
Jacques Lucke
fac64c3378 Cleanup: extract function to read custom data layer data 2024-02-29 14:15:04 +01:00
Jacques Lucke
43b5bd02d4 Cleanup: extract function to write custom data layer data 2024-02-29 14:07:16 +01:00
Brecht Van Lommel
1355285c0e Merge branch 'blender-v4.1-release' 2024-02-29 13:52:19 +01:00
Brecht Van Lommel
a060e96103 Fix #101227: Crash and other issues with non-multiview multipart EXR
Some software stores passes or layers as parts. This case was not
supported by the OpenEXR reader yet.

Pull Request: https://projects.blender.org/blender/blender/pulls/118867
2024-02-29 13:50:18 +01:00
Brecht Van Lommel
1e44d811ac Fix #117485: Crash rendering motion blur with changing curve count
This is not supported so there can be artifacts, but it should not
crash.

Pull Request: https://projects.blender.org/blender/blender/pulls/118859
2024-02-29 13:49:51 +01:00
Alaska
659f05ef28 Fix: Cycles HIP incorrect rendering of clip image textures
This was fixed in the driver quite a while ago:
https://github.com/ROCm/HIP/pull/2229

Ref: #91571
Pull Request: https://projects.blender.org/blender/blender/pulls/118540
2024-02-29 13:49:29 +01:00
Alaska
0a173b942b Cycles: Improve reporting of HIP texture allocation failures
HIP fails to allocate textures, typically when they are too large.
This commit lets the user know what might be causing the issue
rather than providing a confusing internal error message.

Pull Request: https://projects.blender.org/blender/blender/pulls/118239
2024-02-29 13:49:11 +01:00
Jacques Lucke
41b10424c7 WM: explicitly skip auto-save when in modes that don't support it
Auto-save currently only really works in modes that use the `MemFile` undo step,
that excludes things like mesh edit and sculpt mode. Previously, Blender would
attempt to auto-save in those modes, but it would only save the last state from
before the mode was entered, which is useless when staying in the mode for longer.

This problem is *not* fixed here. However, the code now explicitly skips auto-saving
in order to avoid unnecessary short freezes in these modes when Blender auto-saves.
Furthermore, the auto-save will now happen when changing modes.

This reduces the impact of save-time-regressions with #106903.

Pull Request: https://projects.blender.org/blender/blender/pulls/118892
2024-02-29 13:14:58 +01:00
Jacques Lucke
4d13f56f63 Fix: cut off quaternion text overlay 2024-02-29 13:13:00 +01:00
Sebastian Parborg
dc2577d383 Merge branch 'blender-v4.1-release' 2024-02-29 13:12:03 +01:00
Sebastian Parborg
f8741580a6 Fix: Dropping sound/image/movieclip IDs into the VSE would not work as expected
The drop location would not be set correctly as we returned early if and
ID was dropped.
2024-02-29 13:08:51 +01:00
Falk David
584d26106a Curves: Provide resample functions that don't depend on field evaluation
This splits the core part of `resample_to_uniform` into it's own function, so that it doesn't depend on field evaluation.

From there, new versions of `resample_to_count`, `resample_to_length`, and `resample_to_evaluated` are provided.

Pull Request: https://projects.blender.org/blender/blender/pulls/118551
2024-02-29 12:51:15 +01:00
Omar Emara
1bff17cc99 Compositor: Unify plane anti-aliasing between CPU and GPU
This patch unifies the anti-aliasing of plane deforms between the CPU
and GPU compositors. The CPU used a multi-sample approach, where the
mask was computed 8 times with a jitter, then averaged to get smooth
edges. The GPU relied on the anisotropic filtering with zero boundaries
to smooth the edges.

Furthermore, the CPU implementation ignored the anti-aliasing for the
deformed image and also relied anisotropic filtering like the GPU, so
its outputs were different.

To unify both implementation, we use the existing SMAA anti-aliasing
algorithm instead, and use the anti-aliased mask for the image output as
well. This affects both the Corner Pin and Plane Deform nodes.

A consequence of this change for the Plane Deform node is that motion
blur will appear to have less samples, that's because it was sampled
8-times more in the previous implementation. But users can just increase
the samples in the node to account for that.

Pull Request: https://projects.blender.org/blender/blender/pulls/118853
2024-02-29 12:30:16 +01:00
Julian Eisel
30ef07867e UI: Remove excessive padding in asset shelf catalog selector tree
Affects the catalog tree found in the catalog selector popup in the
asset shelf.

Looks like this added the padding for indented items without children
twice, which was misleading (because it would look like items were
nested deeper than siblings with children). I think it was added twice
since 2e02c0c515, which changed how tree view indentation is done.
2024-02-29 12:24:55 +01:00
Aras Pranckevicius
79707c2ae8 Extern: update Audaspace to latest version
No behavior changes, but no need to have a local modification
that sets JOS resampler quality to Medium

This basically contains two PRs that got accepted upstream:
- https://github.com/audaspace/audaspace/pull/19
- https://github.com/audaspace/audaspace/pull/20

Pull Request: https://projects.blender.org/blender/blender/pulls/118896
2024-02-29 12:08:00 +01:00
Campbell Barton
da2ac8ee92 Merge branch 'blender-v4.1-release' 2024-02-29 22:04:23 +11:00
Campbell Barton
3b9b6ebbfa Merge branch 'blender-v4.1-release' 2024-02-29 22:04:20 +11:00
Campbell Barton
c19cdc343f Fix assert with temporary directories beginning with "//"
- Skip leading forward slashes when setting the temp directory.
- Add a utility function to set the temporary directory
  which is used for the user preferences & environment variables.

This issue was raised by #95411 where "//" resolves to "/",
then asserts when passed to Blender's file-system functions.
However the crash referenced in this report looks to be caused
by Collada failing to write to the temporary directory which
can be handled separately.

Ref !118872
2024-02-29 22:01:44 +11:00
Bastien Montagne
ab4387d70e GPv3: Fix wrong handling of data names in FCurve RNA paths in conversion code.
Data name should always be escaped in RNA paths, thanks Campbell (@ideasman42)
for the heads up!
2024-02-29 11:53:34 +01:00
Omar Emara
56f8c1c0f6 Compositor: Unify variable size blur between CPU and GPU
This patch unifies the variable size blur between the CPU and GPU
compositor. The difference is due to how weights are computed and used.
The CPU computed a nested array of weights for every possible size, that
is, from size 1 to the base size. Then, it assumed the kernel was
separable and reconstructed a 2D kernel by selecting two 1D weights
array and multiplying them for every pixel of the blur window.

The GPU on the other hand computes a single quadrant of the 2D weights
kernel and sampled it directly in the blur window. We favor the GPU
implementation since it makes no assumptions about the separability of
the weights kernel and since the CPU has no performance advantage even
with the assumption in place.

Pull Request: https://projects.blender.org/blender/blender/pulls/118834
2024-02-29 11:08:49 +01:00
Omar Emara
aa17aca9ec Compositor: Use original variable size in Blur node
Currently, the CPU compositor smoothes its input size in variable size
mode. It is unclear why this is the case, but it seems the logic is that
sharp transitions in the size input are undesirable. Alternatively, this
is similar to the morphological blurring step in the Defocus node. But
it does not use standard weights and it is not morphological in nature
at all.

This patch removes the smoothing step and uses the original size
provided by the user. Looking at resources online, it seems users almost
always expect the size inputs to be used directly, so there is no reason
for force smooth their inputs.

Pull Request: https://projects.blender.org/blender/blender/pulls/118757
2024-02-29 10:57:18 +01:00