Commit Graph

137908 Commits

Author SHA1 Message Date
Jacques Lucke
ae4cee19ba Merge branch 'blender-v4.2-release' 2024-06-19 18:35:45 +02:00
Laurynas Duburas
9ae063d40b Fix #123325: Curve selection more does not highlight curves
Adds handles to curve types `CURVE_TYPE_CATMULL_ROM`,`CURVE_TYPE_POLY` to fix #123325.
Previously not shown as seemed redundant in `Control Point` edit mode.

Pull Request: https://projects.blender.org/blender/blender/pulls/123373
2024-06-19 18:31:02 +02:00
Falk David
68824a059c Fix script_validate_keymap test
Introduced by dab338a9b0f2a5d86d0a1193c9ad177b8d66dae5.
Removes duplicate keymap entries to fix the test.
2024-06-19 18:25:49 +02:00
Miguel Pozo
a4e39145a6 Merge branch 'blender-v4.2-release' 2024-06-19 18:16:12 +02:00
Miguel Pozo
8fc614fc1b Fix: EEVEE: Use of scene before assignment
Move update_eval_members to the top of init to avoid future issues.
2024-06-19 18:15:27 +02:00
Brecht Van Lommel
21d3c2505c Merge branch 'blender-v4.2-release' 2024-06-19 18:03:24 +02:00
Brecht Van Lommel
da9f586748 Fix #104061: Python GPU module unusable after too early import
Add-ons may attempt to load the GPU module in background mode when no GPU
context has been initialized yet. This would give an error on import.

If then later the GPU context does get initialized, for example for a
render engine, import would still fail as the module is cached.

This reverts commit d7f124f06f3fda59523ed05f12d1f4af6a523ba6, and again
throws errors in methods and constructors instead of module import.

Pull Request: https://projects.blender.org/blender/blender/pulls/123395
2024-06-19 17:54:35 +02:00
Brecht Van Lommel
eaeb8ba8cd USD: Rename active UV Map to "st" by default
This was previously attempted in #109518 and reverted in #112234. Now do
both the changes in the mesh and material export, and make it an option
in USD export. Hydra always renamed to "st" and continues to do it.

Fix #122800: Missing textures with MaterialX materials

Pull Request: https://projects.blender.org/blender/blender/pulls/123326
2024-06-19 17:53:55 +02:00
Attila Áfra
dfd9f9066b Build: Upgrade OIDN to 2.3.0 final
This upgrades OIDN to the final 2.3.0 release.

Co-authored-by: Brecht Van Lommel <brecht@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/123433
2024-06-19 17:53:40 +02:00
Lukas Stockner
fd2bc9d011 UI: Support color picking from underlying viewport buffer
Currently, when color-picking from the viewport, the code will read the final
displayed pixel color and then somewhat attempt to undo the display transform.
However, this has several limitations - for example, precision is limited to 8
bit, and it does not account for e.g. View Transform or exposure/gamma.

Since we have the pre-display-transform color in a GPU texture anyways, this
code therefore adds a View3D-specific eyedropper handler (similar to e.g.
the image space) that reads from the viewport texture.

Pull Request: https://projects.blender.org/blender/blender/pulls/123408
2024-06-19 17:27:54 +02:00
Falk David
60de2752be GPv3: Hide the paint cursor while drawing
This matches the behavior of GPv2. While drawing a stroke
the paint cursor is not shown.
2024-06-19 16:26:19 +02:00
Falk David
c0ff8cf030 Fix #122158: Radial control for radius unit Scene not working correctly
This was due to the fact that the `scale_fac` was not set up correctly for
GPv3.

We now compute the right radius in pixels so we can set up the `scale_fac`.
Note that this removes the logic for GPv2, since it is no longer needed in
Blender 4.3.
2024-06-19 15:31:14 +02:00
Falk David
dab338a9b0 Fix: GPv3: Shortcut 'F' to change brush radius no longer working
This was introduced with b7c570c8543a246054e56a793096f6744662fdb3.
For the draw tools, we no longer use the unified paint settings.
This means that we can't use the `_template_paint_radial_control` anymore.

The fix explicitly sets up the shortcut to use the `brush.size` and `brush.strength`
for the `radial_control` operator.
2024-06-19 15:31:14 +02:00
Falk David
7220f72166 Fix: GPv3: Fallback to view plane if surface projection fails
We expect the projection to return something instead of crashing.
For the case where we can't project onto a surface, we fall back to
view plane projection.
2024-06-19 15:31:14 +02:00
Hans Goudey
c168ef9809 Sculpt: Improve undo node lookup performance
Currently, before and during brush evaluation on large meshes, a
significant amount of time is spent pushing and searching for undo
nodes. Because the undo node storage must be protected by a lock,
this means the CPU ends up spending a large portion of the total
time just waiting for other threads to release the lock while they
search for the correct undo node.

Finding an undo node is currently O(n) because we use linear search.
It's actually very simple to just use a map to replace this though.

For the draw brush impacting a large portion of a 6 million vertex mesh
(the benchmark file from #118145), this change improves brush evaluation
time by almost 60%-- from 1.1s to 0.7s. This doesn't include the cost of
refilling GPU buffers, but it's enough to probably give a noticeable
change for users.

Pull Request: https://projects.blender.org/blender/blender/pulls/123415
2024-06-19 14:12:18 +02:00
Campbell Barton
318dc9ff43 Merge branch 'blender-v4.2-release' 2024-06-19 21:04:09 +10:00
Falk David
513e22fa49 Fix: GPv3: Simplify pixel threshold conversion to big
The previous approximation lead to values that were a bit too large.
Generally, there won't be a perfect conversion value, but at least the
defaults from GPv2 should give reasonable results.
2024-06-19 13:00:08 +02:00
Pratik Borhade
900221b697 Cleanup: Typo in namespace
Pull Request: https://projects.blender.org/blender/blender/pulls/123429
2024-06-19 12:55:00 +02:00
Campbell Barton
da3461f8eb Fix #123241: Wrong dialog shown when dropping an unsupported package
Dropping an extension URL for an incompatible package displayed the
"Unknown Repository" dialog.

Resolve by detecting the case of an unknown package being dropped from
a known repository. Noting the package may not be compatible.
2024-06-19 20:47:55 +10:00
Lukas Tönne
c714aa64e8 Fix #123352: Time offset chain mode inserts wrong keys
The time offset modifier inserts keys sequentially, overwriting earlier
frames with later ones, and only the last relevant frame remains used.

In chain mode this process is repeated for every chain segment and then
all segments are repeated to fill the entire timeline. However, because
all keyframes are inserted for every repetition, they can overwrite
keyframes from earlier repetitions as well.

Clamping the insert keyframe makes sure that no keys are inserted
outside of the target range for a give repetition.

Pull Request: https://projects.blender.org/blender/blender/pulls/123423
2024-06-19 12:42:21 +02:00
Jacques Lucke
5b572bd913 Merge branch 'blender-v4.2-release' 2024-06-19 12:18:07 +02:00
Jacques Lucke
934041e8d6 BLO: support overaligned types in SDNA
This fixes #121695. `float4x4` matrices are generally expected to be 16 byte aligned.
Currently, there is no mechanism (afaik) that allows allocating these overaligned types
when loading files from disk. This patch adds an array with alignment information for
 each type in `SDNA`. Currently, the alignment is just `__STDCPP_DEFAULT_NEW_ALIGNMENT__`
for all types and is manually set for the `mat4x4f` DNA type. The .blend file format is
not changed at all. The alignment information is purely runtime data.

In the future it would probably be good to generalize this a bit more instead of
hardcoding the alignment for `mat4x4f`, but would make it unnecessarily complex for
now because this is intended for the release branch.

Pull Request: https://projects.blender.org/blender/blender/pulls/123271
2024-06-19 12:16:24 +02:00
Jacques Lucke
1d4b4440d9 Curve: reduce overhead in debug builds 2024-06-19 12:08:27 +02:00
Aras Pranckevicius
7a4c007aa0 Merge branch 'blender-v4.2-release' 2024-06-19 12:58:46 +03:00
Aras Pranckevicius
7e61f14a88 Fix #123332: VSE strip transform handles look tweaks
Current look of VSE timeline view strip transformation handles makes them
somewhat "too narrow", especially after recent changes that made them
more narrow than before (handle tweaking feature) and a strip visual change
that made strip outline not go outside of strip bounds. They are now just
2px wide, effectively.

This changes their look as outlined in #123332 design task:
- The inset dark line is no longer over the handles, but rather "inside"
  of them (except when handles are semitransparent, i.e. for strips that
  are not selected).
- The handles themselves have rounded corners.

Pull Request: https://projects.blender.org/blender/blender/pulls/123391
2024-06-19 11:49:20 +02:00
Campbell Barton
295ffeeb02 Merge branch 'blender-v4.2-release' 2024-06-19 19:40:18 +10:00
Campbell Barton
a3c89f2e4e Merge branch 'blender-v4.2-release' 2024-06-19 19:40:15 +10:00
Campbell Barton
50bb98fba5 Fix #123339: Blender fails to build with older versions of wayland
Follow up to [0] which only addressed one of the issues.

[0]: bc7cb481dab9d0f9c22d4c59e90930be9a3a6511
2024-06-19 19:36:10 +10:00
Damien Picard
2948b1e790 Give timeline marker default name when created via binding to camera
Timeline markers get a default name of "F_<frame>" when creating with
`marker.add`, but an empty name with `marker.camera_bind`.
Because the name of the current frame's marker is displayed in the
viewport statistics, such markers appear as "<>" after the name of the
active object, which is confusing.

This change gives the same default name of "F_<frame>" to markers
created this way.
It also cleans up a comment in the line copied from, as that line was
introduced in late 2008 so probably not so temporary.

Pull Request: https://projects.blender.org/blender/blender/pulls/122968
2024-06-19 11:22:28 +02:00
Jacques Lucke
24e063aee6 Merge branch 'blender-v4.2-release' 2024-06-19 11:21:55 +02:00
Jacques Lucke
ed357136dc Fix #123410: node frames interfere with node hide toggle
Now the `uiBlock` array for node is indexed with `node.index()` instead
of the draw-index which is not as readily available in some cases.
The main alternative would be to create an extra map from node index
to draw-index but that doesn't seem worth it right now.
2024-06-19 11:21:12 +02:00
Aras Pranckevicius
2296d3a94b Merge branch 'blender-v4.2-release' 2024-06-19 12:20:34 +03:00
Aras Pranckevicius
189410e1ff Fix #123333: VSE strip outline width now takes DPI/line width setting into account
Now the strip outline (1 point for unselected strips, 2 point outline +
1 pt dark inset) takes monitor DPI / user preference line width into
account, via the usual U.pixelsize machinery.

Pull Request: https://projects.blender.org/blender/blender/pulls/123369
2024-06-19 11:19:15 +02:00
Omar Emara
0582553bb0 Merge branch 'blender-v4.2-release' 2024-06-19 11:48:17 +03:00
Omar Emara
4329dafb4c Fix #123340: Zero division in Difference Key node
The Difference Key node suffered from zero division when the falloff is
zero. Fix that by using safe division.
2024-06-19 11:46:09 +03:00
Sergey Sharybin
dc88f53f21 Merge branch 'blender-v4.2-release' 2024-06-19 10:42:42 +02:00
Alaska
10737d719e Cleanup: Correct Cycles code comment
The code comment references a variable that was removed during the
review process of !123341

Pull Request: https://projects.blender.org/blender/blender/pulls/123409
2024-06-19 10:42:13 +02:00
Omar Emara
4f51033708 Nodes: Implement Gabor noise
This patch implements a new Gabor noise node based on [1] but with the
improvements from [2] and the phasor formulation from [3].

We compare with the most popular existing implementation, that of OSL,
from the user's point of view:

  - This implementation produces C1 continuous noise as opposed to the
    non continuous OSL implementation, so it can be used for bump
    mapping and is generally smother. This is achieved by windowing the
    Gabor kernel using a Hann window.

  - The Bandwidth input of OSL was hard-coded to 1 and was replaced with
    a frequency input, which OSL hard codes to 2, since frequency is
    more natural to control. This is even more true now that that Gabor
    kernel is windowed as opposed to truncated, which means increasing
    the bandwidth will just turn the Gaussian component of the Gabor
    into a Hann window. While decreasing the bandwidth will eliminate
    the harmonic from the Gabor kernel, which is the point of Gabor
    noise.

  - OSL had three discrete modes of operation for orienting the kernel.
    Anisotropic, Isotropic, and a hybrid mode. While this implementation
    provides a continuous Anisotropy parameter which users are already
    familiar with from the Glossy BSDF node.

  - This implementation provides not just the Gabor noise value, but
    also its phase and intensity components. The Gabor noise value is
    basically sin(phase) * intensity, but the phase is arguably more
    useful since it does not suffer from the low contrast issues that
    Gabor suffers from. While the intensity is useful to hide the
    singularities in the phase.

  - This implementation converges faster that OSL's relative to the
    impulse count, so we fix the impulses count to 8 for simplicitly.

  - This implementation does not implement anisotropic filtering.

Future improvements to the node includes implementing surface noise and
filtering. As well as extending the spectral control of the noise,
either by providing specialized kernels as was done in #110802, or by
providing some more procedural control over the frequencies of the
Gabor.

References:

[1]: Lagae, Ares, et al. "Procedural noise using sparse Gabor
convolution." ACM Transactions on Graphics (TOG) 28.3 (2009): 1-10.

[2]: Tavernier, Vincent, et al. "Making gabor noise fast and
normalized." Eurographics 2019-40th Annual Conference of the European
Association for Computer Graphics. 2019.

[3]: Tricard, Thibault, et al. "Procedural phasor noise." ACM
Transactions on Graphics (TOG) 38.4 (2019): 1-13.

Pull Request: https://projects.blender.org/blender/blender/pulls/121820
2024-06-19 09:33:32 +02:00
Campbell Barton
df78d23f93 Merge branch 'blender-v4.2-release' 2024-06-19 16:01:53 +10:00
Campbell Barton
6eb2b5f47b Fix local extension errors being shown as remote errors
Also fix error with non extension add-on display by removing
an exception for extensions which is no longer needed.
2024-06-19 15:58:45 +10:00
Hans Goudey
d70bd00422 Merge branch 'blender-v4.2-release' 2024-06-18 23:49:46 -04:00
Hans Goudey
86e1ef2e31 Fix: Memory leak in purge orphans with no unused data-blocks
Operator cutom data was allocated but not freed in the early return.
2024-06-18 23:49:18 -04:00
Hans Goudey
b9f86b831c Sculpt: Avoid threading overhead for area/normal sampling function
Remove the `any_vertex_sampled` variable, which was just used when only
sampling the area normal, and was unnecessary since we also keep track
of how many vertices passed the sample tests. Though it's a simple
change, this more than doubles the performance of the sculpt brush
benchmark file from #118145 on my hardware, from 1.76s to 0.74s for
the brush evaluation. This is likely because writing to the same
memory from many separate threads interacts very poorly with CPU
caches. If this variable weren't unnecessary, another option would
be including it in the parallel reduction.
2024-06-18 23:19:21 -04:00
Hans Goudey
903e926809 Cleanup: Sculpt: Use const references for area normal/center sampling 2024-06-18 23:01:52 -04:00
Hans Goudey
d4a9d68a18 Cleanup: Sculpt: Extract view normal variable 2024-06-18 22:58:22 -04:00
Hans Goudey
417b0df883 Cleanup: Sculpt: Remove unnecessary undo type argument
Pull Request: https://projects.blender.org/blender/blender/pulls/123411
2024-06-19 04:54:56 +02:00
Hans Goudey
80e197e33c Cleanup: Sculpt: Use node argument instead of retrieving from undo node 2024-06-18 22:15:32 -04:00
Hans Goudey
21f204b06e Sculpt: Move object name out of per-node undo data
The object name is the same for all of the nodes in the vector,
there's no need to duplicate it for each one.
2024-06-18 22:15:32 -04:00
Hans Goudey
4854d69745 Cleanup: Sculpt: Simplify initialization/destruction of undo step data 2024-06-18 22:15:32 -04:00
Hans Goudey
de1c911d49 Sculpt: Initial data oriented refactor for clay strips brush
Part of #118145.
There isn't much to comment on here compared to the other refactors.
I measured something like a 20% performance improvement on the
benchmark file, but there are some obvious problems with the brush's
influence radius and affect in the benchmark file that that isn't a very
useful measurement.

Pull Request: https://projects.blender.org/blender/blender/pulls/123154
2024-06-19 03:25:36 +02:00