Commit Graph

146339 Commits

Author SHA1 Message Date
Jason C. Wenger
6a4e7edf8a Fix BMesh split-op failing to output boundary & isovert_map slots
These were defined but never written to.

Part of !129318.
2025-02-18 12:09:05 +11:00
Harley Acheson
37c0b2c47d Fix #134592: Node Editor space_*_get Unregistered Tree Type Returns
When needing a friendly title and icon for windows and screen areas we
use SpaceType callbacks. For Node editors this could crash for custom
node trees that are unregistered. node_tree_type_find returns nullptr
since this custom tree type is not in the map. In this case just return
translated "Node Editor".

Pull Request: https://projects.blender.org/blender/blender/pulls/134692
2025-02-17 20:03:22 +01:00
Harley Acheson
3e77dd1e46 Fix: Enable Translation Options by Default
This PR changes the default user preferences so that the Translation
Options are enabled. Otherwise with fresh install changing language
only translates tooltips.

Pull Request: https://projects.blender.org/blender/blender/pulls/134649
2025-02-17 18:46:43 +01:00
Maxime-Cots
b6617ae946 Fix #134451: SVG: Reuse material data on SVG Import
Reuse SVG Material and prevent creation of duplicate material
multiple times. Issue occurred because the check for a duplicate
material was placed too early.

Co-authored-by: Nig3l <nig3lpro@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/134529
2025-02-17 18:31:53 +01:00
Guillermo Venegas
f0d6391bd9 Fix: quiet warning const qualifier is applied to a function type
This avoids to adding const to the function type in a function pointer
while enabling `Span<FunctionType*>(Span<FunctionType*>)` ctor.

`Span<const FunctionType*>` should be considered invalid.

The warning: https://learn.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4180?view=msvc-170

Pull Request: https://projects.blender.org/blender/blender/pulls/134425
2025-02-17 16:28:56 +01:00
Omar Emara
003fb98f9d Fix #134567: Compositor memory leak in some setups
The compositor leaks memory in certain setups where a transformed result
is linked to two inputs in the same pixel node. This happens due to an
overestimation in the computation of reference counts of those results.
Since pixel operations might share the same input for multiple links in
the node tree, the reference count should be corrected to take that
sharing into account.

This sharing was previously accounted for as part of releasing inputs in
the pixel operation, but input processors didn't take that into account,
so the realize on domain input processor would leak memory. So to fix
this, we correct the reference count at the evaluator level instead,
such that input processors can safely operate on the correct reference
count.

Pull Request: https://projects.blender.org/blender/blender/pulls/134666
2025-02-17 15:55:22 +01:00
Bastien Montagne
48b12c6deb I18N: Updated UI translations from git/weblate repository (a5066e76fb25f0). 2025-02-17 15:25:44 +01:00
Jeroen Bakker
ed5b077f92 Fix #134634: Overlay: Mask not drawing on top of render result/viewer
Logical error in the overlay engine. Moved mask drawing before the early
exit for viewer/render results.

Pull Request: https://projects.blender.org/blender/blender/pulls/134660
2025-02-17 14:14:12 +01:00
Jacques Lucke
78b5c47c46 Fix #134669: crash because of dangling socket declaration pointer 2025-02-17 12:37:23 +01:00
Andrej730
b9bbf48841 Fix: PyDocs typing issue with lists
Fixed use of lists using multiple arguments - `list` only
support a single argument.

Noticed working with fake-bpy-module - providing multiple
arguments to `list` resulted in typing error (e.g. "Too many type
arguments provided for "list"; expected 1 but received 2").

Pull Request: https://projects.blender.org/blender/blender/pulls/134663
2025-02-17 10:58:11 +01:00
Bastien Montagne
8ad740ae95 API Docs: Add some more precisions about calling __init__ for Blender-derined classes.
Hopefully will avoid confusion like in #134600.
2025-02-17 10:49:04 +01:00
Falk David
1a071ef755 Fix #134490: Grease Pencil: Clone brush in sculpt mode not working
The main issue was that the code was using
`foreach_editable_drawing_with_automask` which shouldn't have been
the case since there is no "masking" to be done when pasting strokes.

Additionally the code was computing the view position of every
pasted point and then computing the offset to move the points to the
mouse position.

Instead, we compute the center of the 3d bounds of the pasted strokes
and then project only the center to the view. From there we can offset
all the points to move them under the mouse cursor.

It's a bit weird to do this projection of the center to the view and
I believe we mainly do it to reuse the `DeltaProjectionFunc`.
There are cases where the projection of the center to the view will fail
which can lead to unexpected behavior on the user end. For now we
just leave the pasted strokes where they were copied from, which
isn't ideal. But this can be improved later.

Pull Request: https://projects.blender.org/blender/blender/pulls/134589
2025-02-17 10:38:02 +01:00
Jeroen Bakker
0faba244a5 Fix: Vulkan: Async readback of storage buffers
The vulkan backend was implemented with async in mind, however the one place
where Blender uses for async was implemented blocking. This PR splits the
readback into flushing the command and waiting for readback.

**Performance**

Improvement of animation playback performance of shader balls.blend is around 10%.
Shader balls.blend frame: 1-100, 10 x animation playback

| Branch               | Total time | Average time |
| -------------------- | ---------- | ------------ |
| blender-v4.4-release | 26851 ms   | 2685 ms      |
| This PR              | 23675 ms   | 2367 ms      |

Pull Request: https://projects.blender.org/blender/blender/pulls/134227
2025-02-17 08:58:06 +01:00
kgalik
c3d92f32dc NDOF: Rework input handling on macOS
This patch modifies the logic behind handling NDOF device events on
macOS so that it can benefit from the `Blender` profile available in
3DConnexion driver v10.8.7 and later.

A new device command was introduced: `kConnexionCmdAppEvent`, which is
sent by the driver upong getting an apprioriate NDOF device button
input. This allow the driver to consumes all NDOF device input and then
send appropriate app events based on its configuration instead of
forwarding raw data to the application directly.

When using 3DConnexion driver versions prior to v10.8.7, the behavior
is unchanged. This approach allows for supporting all of the SpaceMouse
Enterprise buttons, long presses included (solving issue #119206 on macOS)

Co-authored-by: Sergey Sharybin <sergey@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/126694
2025-02-16 23:39:24 +01:00
Campbell Barton
665b4dfbad Fix IDProperty comparison warning in debug mode
The warning to check if two numbers are nearly equal when comparing
floats didn't take negative numbers into account, causing -1.0 & 0.0
for e.g. to be considered not equal but close.
This also resolves a divide by zero.
2025-02-16 20:56:07 +11:00
Campbell Barton
a80bd2744d Fix incorrect null checks in animadata::find_related_ids 2025-02-16 19:39:44 +11:00
Pratik Borhade
9dddef9581 Fix #134316: Color being sampled from hidden faces in texture paint
If face that has been hit is hidden, skip sampling from the face,
instead use current pixel color.

Pull Request: https://projects.blender.org/blender/blender/pulls/134321
2025-02-16 08:58:52 +01:00
Campbell Barton
c80980d10b Fix #125376: Standalone bpy module can crash on exit 2025-02-16 18:27:02 +11:00
Campbell Barton
78ccea432f UI: correct array size check for colors
Allow arrays to be larger than 4.

Related to #134537.
2025-02-16 17:14:12 +11:00
Campbell Barton
96179be206 Cleanup: cmake indentation 2025-02-16 17:14:12 +11:00
Alaska
74808ac2c3 Tests: Enable OptiX OSL generated volumetric texture coordinate tests
In a recent commit (1), a bug was fixed where the generated texture
coordinates on volumes in Cycles with OptiX OSL was incorrect.

Due to this fix, OptiX OSL now passes render tests in scenes that use
that feature, so this commit enables those tests on that platform.

(1) 0177537c9a

Pull Request: https://projects.blender.org/blender/blender/pulls/134629
2025-02-16 06:02:04 +01:00
Lukas Stockner
0177537c9a Fix #129279: Cycles: Matrix-typed attributes not working in OptiX OSL
The issue here is that the individual components of TypeDesc are 8-bit each,
but the code was applying a 4-bit mask. It just so happens that the only
case where this matters is TypeDesc::MATRIX44, since its value is 16.
2025-02-15 19:31:07 +01:00
Alaska
bcec81c4be Fix: Overflow when using light falloff node on distant lights
In Cycles lights can be given a light falloff node to control their
light falloff.

This worked by multiplying the light's strength by different
combinations of the ray length, which would be FLT_MAX for
distant lights. This resulting in almost every configuration of the
light falloff node overflowing when used on distant lights, which is
undesirable.

This commit fixes this issue by ignoring most of the functions of the
light falloff node when used on a distant light.

And in the process fixes a small discrepancy between SVM and OSL when
using the light falloff node on distant lights.

Pull Request: https://projects.blender.org/blender/blender/pulls/134539
2025-02-15 01:23:12 +01:00
Sean Kim
3f6bf5ae05 Cleanup: Minor changes for recently added bl_object.py
* Adds SPDX license header
* Resets scene in more standard way

Pull Request: https://projects.blender.org/blender/blender/pulls/134543
2025-02-15 00:09:10 +01:00
Hans Goudey
77ed7bfca5 Fix: Incorrect selection field type in Set Selection node
The selection can be float or boolean for these geometry types.
At the very least this caused asserts in debug builds.
2025-02-14 15:43:19 -05:00
Hans Goudey
76794727d6 Fix: Spreadsheet point cloud selection filter with no attribute wrong
This shouldn't really affect the release since original point cloud data is hidden
but it might and the fix is trivial anyway: everything is selected when there's no
attribute, just like curves.
2025-02-14 15:42:23 -05:00
Harley Acheson
99d028cd7d Fix #134492: Do Not Assign Toggle Accelerators on First Pass
With ba9417470e we are assigning keyboard accelerator shortcuts to
menu items containing toggles. This PR makes the assignment to these
new items not occur on the first pass of doing so. This is less
disruptive in that first-letter shortcuts will remain the same from
prior versions, with only mid-word shortcuts possibly changing.

Pull Request: https://projects.blender.org/blender/blender/pulls/134526
2025-02-14 18:41:33 +01:00
Bastien Montagne
69f7530f7a Fix (unreported) invalid C-style allocation of non-trivial C++ data. 2025-02-14 18:39:24 +01:00
Falk David
bd5023349a Fix: Grease Pencil: Points copied from same stroke were not split
When copying (`Ctrl+C`) some ranges of points in the same stroke,
the points would still be copied as one stroke and not split into
multiple strokes.

This was a regression in behavior from 4.2.

Now we use the `remove_points_and_split` to split the selected
points into individual strokes.
2025-02-14 18:26:13 +01:00
Jacques Lucke
bb715caf94 Fix #134100: hair curves disappear when adding new curves without radius interpolation
The issue is that the existing curves did not have an explicitly set radius.
When adding new curves with an explicit radius, the radius of the old curves was
initialized to 0 and thus becoming invisible. This patch changes it so that all
the existing curves do get a default radius. The `radius_for_write` methods is
currently only used in places that overwrite the entire array, so adding the
default there shouldn't affect anything unintentionally.

Pull Request: https://projects.blender.org/blender/blender/pulls/134445
2025-02-14 17:41:59 +01:00
Xavier Hallade
a5601f68db Fix: Restore Cycles oneAPI host memory fallback on Linux
free_memory queries were disabled due to runtime driver issues on Linux
when using jemalloc.
compute-runtime introduced a fix for these issues with
8527779778
which is part of versions 31740 and higher, and matches the currently
required min-driver version, so we can restore this feature.

Pull Request: https://projects.blender.org/blender/blender/pulls/134542
2025-02-14 17:37:27 +01:00
Bastien Montagne
bbebf72a33 Cleanup: Add explicit defaults to MEM_new-allocated structs with no constructors.
While not strictly needed (currently!), relying on C++ 'default
initialization' is fragile and unreliable.
2025-02-14 17:07:23 +01:00
Bastien Montagne
7000c392ff Cleanup: Add explicit defaults to MEM_new-allocated structs with no constructors.
While not strictly needed (currently!), relying on C++ 'default
initialization' is fragile and unreliable.
2025-02-14 17:07:23 +01:00
Falk David
2cc6f7bbb5 Fix #133339: Grease Pencil: Ensure span attribute writers are valid
When calling the `lookup_or_add` functions on `MutableAttributeAccessor`
we need to make sure that the writer is actually created and the call
did not fail.

This fixes many of the instances where we would use an unchecked
attribute writer and potentially crash.

Pull Request: https://projects.blender.org/blender/blender/pulls/134413
2025-02-14 15:54:20 +01:00
Anthony Roberts
d277d43831 Libs: Fix OCIO patch command for non-Windows ARM64 platforms
Pull Request: https://projects.blender.org/blender/blender/pulls/134576
2025-02-14 15:44:08 +01:00
Anthony Roberts
394d204758 Windows ARM64: Update libs to use patched OCIO
See #134568 for more details

Pull Request: https://projects.blender.org/blender/blender/pulls/134572
2025-02-14 15:03:17 +01:00
Anthony Roberts
cbfe542f61 Windows ARM64: Enable SIMD in OpenColorIO
Pull in a patch from December 2024 that didn't make it into a versioned release yet

This gives a speed-up of ~50% in some video rendering scenarios

Pull Request: https://projects.blender.org/blender/blender/pulls/134568
2025-02-14 14:12:39 +01:00
Sybren A. Stüvel
62c21a0800 Fix: NLA Track Solo flag handling, in depsgraph and F-Curve iteration
This fixes the (unreported) issue where solo'ing an NLA track would only
play back animation when _any_ of the tracks were unmuted.

Some code considered a track to be muted when its `NLATRACK_MUTED` flag
was set regardless of the `NLATRACK_SOLO` flag, whereas other code did
consider the `NLATRACK_SOLO` flag.

Now all the code is consistent with what actual animation evaluation is
doing.

Pull Request: https://projects.blender.org/blender/blender/pulls/134500
2025-02-14 13:55:44 +01:00
Campbell Barton
79627e353d Fix #134537: Crash accessing colors in the UI with more than 4 elements
The UI code assumed buttons had no more than 4 elements
however Python scripts may define larger array sizes.

Resolve the bug by adding functions for array access that take an
array size limit to prevent buffer overflows (read & write).

Note that this only adds the "float" versions of these functions,
for completeness int & boolean can be supported as a separate commit.
2025-02-14 23:33:54 +11:00
Bastien Montagne
248d858475 Fix (unreported) invalid C-style allocation of non-trivial C++ data.
A bit less trivial than usual, since it was an 'array' of non-trivial
structs. Used a `blender::Array` instead.

NOTE: keeping changes to a minimum, there is much to refactor and
cleanup in this code.
2025-02-14 12:59:54 +01:00
Sybren A. Stüvel
c74f9e65ec Fix #134190: NLA track not evaluating when toggling its 'mute' setting
Add a new callback `setting_post_update` to the `bAnimChannelType`
that gets called after that setting was altered via the channel list
buttons and via `ANIM_channel_setting_set()`.

This is used when changing the NLA track SOLO and MUTE options, to
ensure that the dependency graph relationships get rebuilt.

This fixes #134190.

Pull Request: https://projects.blender.org/blender/blender/pulls/134347
2025-02-14 12:52:02 +01:00
Bastien Montagne
194e233d86 Fix (unreported) more invalid C-style allocation of non-trivial C++ data. 2025-02-14 12:23:38 +01:00
Ankit Meel
13c3d95f52 Xcode/thumbnailer: rebuild error due to rpath
Fix duplicate rpath error on rebuild by using CMake target
property.

Pull Request: https://projects.blender.org/blender/blender/pulls/134527
2025-02-14 10:46:48 +01:00
Alaska
fee2f10208 Fix: Incorrect ray depth on emission in Cycles OSL
This commit fixes a issue where ray depth for emissive objects
(E.g. Lights) was incorrect when using the ray depth output of the
light path node in Cycles OSL.

Pull Request: https://projects.blender.org/blender/blender/pulls/134496
2025-02-14 05:09:08 +01:00
Anthony Roberts
088262dfee Windows ARM64: Check and cache VSCMD version
This uses the same technique as the one earlier in the file, that checks the `VCToolsRedistDir` env var

Pull Request: https://projects.blender.org/blender/blender/pulls/134522
2025-02-13 19:59:31 +01:00
Brecht Van Lommel
c87a269021 Fix #133953: Cycles oneAPI texture randomly renders black
* Do oneAPI copy optimization as part of host memory alloc and free, so
  it is properly released before host memory is freed.
* Synchronize after loading texture info, like CUDA and HIP.

https://projects.blender.org/blender/blender/pulls/134412
2025-02-13 19:58:56 +01:00
Brecht Van Lommel
f99f958c47 Refactor: Cycles: Add host_alloc/free to device API
This may be used for device to do host memory allocation in a way that
is more efficient for copy the host memory to the device.

Also rename and group device memory allocation functions for clarity.

Pull Request: https://projects.blender.org/blender/blender/pulls/134412
2025-02-13 19:58:56 +01:00
Bastien Montagne
455d419f1e Fix (unreported) invalid C-style allocation of non-trivial C++ data. 2025-02-13 19:24:17 +01:00
Fabricio Luis
afec64739a Fix #130372: Implements memory of the previous state of eSpace_Types.
This implements the memorization of the previous state of a space's
subtype for those that have multiple modes. Introduces an optional
space_subtype_prev_get callback, implemented for SPACE_ACTION,
SPACE_FILE, SPACE_GRAPH, SPACE_IMAGE and SPACE_NODE. This means we
can always return to the previous mode.

Pull Request: https://projects.blender.org/blender/blender/pulls/133846
2025-02-13 18:45:00 +01:00
Sergey Sharybin
ee8b9a3799 Fix: Adding new objects in HIP-RT rendered viewport errors out
The issue was caused by c0ba800f64.

Simple solution for now: check the data size and free the memory to
allow the device memory to be re-allocated. Seems the safest for the
upcoming release.

Ideally we'd need to avoid having these manual tricks with the device
memory pointers.

Pull Request: https://projects.blender.org/blender/blender/pulls/134516
2025-02-13 18:42:05 +01:00