Commit Graph

146386 Commits

Author SHA1 Message Date
Philipp Oeser
c042c67011 Fix #134395: "Intersect" selection mode not working for Grease Pencil
Intersect mode needs to set everything **outside** of the selection mask
to non-selected and leave the rest untouched.
We already had the comment to "un-set all elements not in the mask" but
that was actually unsetting **everything**.

In theory, we could also early out for `SEL_OP_AND` since the following
`apply_mask_as_` calls are not doing anything for `SEL_OP_AND` really
(but left the change to be minimal).

Pull Request: https://projects.blender.org/blender/blender/pulls/134400
2025-02-11 18:54:02 +01:00
Jacques Lucke
1cb2d991f9 Fix #134230: missed multi-threading opportunity when using repeat zone
In setups where only very few elements are processed at once, the lazy-threading
hints that come from `parallel_for` are not triggered. However, often it can
still be worth to use multi-threading in such cases. Therefore, we need to find
additional places where the lazy-threading hints are sent. There are many
possibilities and we probably have to add them step by step as we find .blend
files that show missing multi-threading.

In this patch I choose to send the hint at the beginning of evaluating a repeat
zone if it has 10 or more iterations. The exact number here is just a guess and
could be fine tuned over time if necessary.

A slightly modified version of the file in #134230 speeds up from ~1100ms to
~100ms with this change. The exact speedup changes quite a bit each run, but is
always between 5 and 20x, so it's quite noticable.

Pull Request: https://projects.blender.org/blender/blender/pulls/134408
2025-02-11 17:46:53 +01:00
Jacques Lucke
d28cf7a469 Fix #134283: defer freeing tree/node/socket types
Currently, tree, node and socket types are always freed immediately when the
Python code unregisters them. This is problematic, because there may still be
references to those type pointers in evaluated data owned by potentially various
depsgraphs. It's not possible to change data in these depsgraphs, because they
may be independent from the original data and might be worked on by a separate
thread. So when the type pointers are freed directly, there will be a lot of
dangling pointers in evaluated copies. Since those are used to free the nodes,
there will be a crash when the depsgraph updates. In practice, this does not
happen that often, because typically custom node tree addons are not disabled
while in use. They still used to crash often, but only when Blender exits and
unregisters all types.

The solution is to just keep the typeinfo pointers alive and free them all at
the very end. This obviously has the downside that the list of pointers we need
to keep track of can grow endlessly, however in practice that doesn't really
happen under any normal circumstances.

I'm still getting some other crashes when enabling/disabling Sverchok while
testing, but not entirely reliably and also without this patch (the crash there
happens in RNA code). So some additional work will probably be needed later to
make this work properly in all cases.

Pull Request: https://projects.blender.org/blender/blender/pulls/134360
2025-02-11 17:25:10 +01:00
Falk David
9438597b34 Fix: Grease Pencil: Remove invisible layers from evaluated data
Previously, all the layers were part of the evaluated state, even if
they were hidden.

Hidden layers should be treated as "disabled" meaning that we should
not evaluate them and/or render them at all.

This fixes this by removing hidden layers from the evaluated data before
layer adjustments and modifier evaluation starts.

As a consequence, hidden layers are no longer accessible in Geometry
Nodes. Technically, this is a breaking change. In the unlikely case that
a user relied on hidden layers to be evaluated within modifiers, they
need to make sure that the layer is visible.

Pull Request: https://projects.blender.org/blender/blender/pulls/133973
2025-02-11 16:49:51 +01:00
Omar Emara
4137fdf555 Fix #134259: Compositor crash when passes are used
In certain setups where passes are used in the viewport compositor,
blender will crash. This happens because passes may not be available
when the compositor first run but then become available in later runs.
Possibly because EEVEE is still compiling shaders. This is problematic
for the compositor because it caches the result of node tree compilation
for the specific data available, like passes, and the compositor does
not get informed when data becomes available like in the case of EEVEE
to invalidate the cached node tree compilation result.

Caching of node tree compilation was always a source of bugs but we
managed to workaround them in the past, so before we work on a fix for
this crash, we first evaluate the removal of caching to see if we can
live without it. Especially since a fix will be rather involved for the
release branch at this stage.

The time it takes to compile the node tree is:

- Small Tree (~10 nodes): 0.3ms.
- Medium Tree (~50 nodes): 0.6ms.
- Huge Tree (~300 nodes): 3ms.

The difference is not noticeable to the eye, probably since as the tree
becomes bigger, the evaluation time becomes more dominant, and small
trees are fast to compile.

It should be noted that we intended to remove caching in the future to
support things like lazy evaluation of node inputs, but we though a few
optimization needs to be done on the GPUMaterial compiler side to make
compilation faster, since it is the main bottleneck during compilation.

So considering this, I think it is acceptable to disable caching of node
tree compilations for the time being. I intend to optimize it such that
it always becomes less than 1ms, but we will have to delay that to 4.5.

Pull Request: https://projects.blender.org/blender/blender/pulls/134394
2025-02-11 15:35:41 +01:00
Bastien Montagne
810060d837 RNA: Fully clear data in RNA_POINTER_INVALIDATE.
Not really sure why only type and owner_id were cleared here?
Especially when code like `pyrna_struct_CreatePyObject` would check
for both `data` and `type` to be null to consider the pointer as None...

Happens to 'fix' #134311, since now cleared PointerRNA are 'just'
reset to `PointerRNA_NULL`. Would not work if the data was not an
ID PointerRNA though...

NOTE: In general, what is considered an invalid PointerRNA is still very
loosely designed in our code-base, we'll have to address this.

Pull Request: https://projects.blender.org/blender/blender/pulls/134393
2025-02-11 14:47:44 +01:00
Sebastian Parborg
dfb1b58681 Libs: Update to 4.4 Linux libs
See #128577 for more information

Pull Request: https://projects.blender.org/blender/blender/pulls/134340
2025-02-11 11:39:57 +01:00
Pratik Borhade
8fc493f321 Fix #134182: Regression: Enabling Tweak disappears NLA strip
Likely caused by d94a56bdad. In `ANIMDATA_FILTER_CASES` macro,
function call to `animfilter_nla` is not made due to legacy action
condition checks. Since legacy actions are already converted to new
layered action structure in `convert_legacy_animato_actions`, it seems
safe to remove those conditions from macro.

Pull Request: https://projects.blender.org/blender/blender/pulls/134209
2025-02-11 11:35:31 +01:00
Campbell Barton
f2a1c8d77c Fix writing a blend file to a directory "versioning" the path
Writing a blend file to a path that references a directory wasn't
being handled correctly.

When the save "versions" was greater than zero the directory would
be renamed (adding a 1), otherwise there would be a
"Version backup failed" error.

Resolve by exiting with an error in the unlikely event the user saves
over a directory.

Part of a fix for #134101.

Ref !134384
2025-02-11 21:32:06 +11:00
Campbell Barton
29076ebd75 UI: avoid potential error accessing freed memory 2025-02-11 17:21:02 +11:00
Campbell Barton
dab47b83a8 Cleanup: de-duplicate numbered key definition with loop 2025-02-11 12:09:19 +11:00
Campbell Barton
c9bbc767db Docs: correct context.temp_override example
Address #134296
2025-02-11 10:51:05 +11:00
Brecht Van Lommel
f63c192543 Fix: Cycles OptiX with OSL 1.14 failure in some render tests 2025-02-10 19:34:24 +01:00
Clément Foucault
4e6f5d43b0 EEVEE: Update Metal Blocklist to make GPU tests pass
`environment_mirror_ball.blend` and `image.blend` are both
failling because of mipmap/anisotropic filtering differences
on apple silicon.

The volume tests has issues with lightprobe baking.

Blocking them until we have a workaround.
2025-02-10 18:58:47 +01:00
Nicola
92c89b504b Fix: Ignore original plane and normal when brush type is Plane
The `Plane` brush type does not use the original plane/normal
parameters. However, these parameters can be incorrectly retained when
switching type to `Plane` from another brush type where they were
enabled. This commit ensures that they are ignored for the `Plane` brush
type.

Pull Request: https://projects.blender.org/blender/blender/pulls/134255
2025-02-10 18:54:05 +01:00
Habib Gahbiche
e6260ac9f5 Fix #134107: Snapping while resizing nodes not working
The grid size varied depending on the UI scale. This caused unintended behavior with snapping while resizing nodes.

Pull Request: https://projects.blender.org/blender/blender/pulls/134123
2025-02-10 17:56:22 +01:00
Lukas Tönne
9842ecb6b8 Fix #134309: Grease Pencil: SVG export crashes on constructive modifiers
The use of `GeometryDeformation` is incorrect for computing the bounds:
It contains _evaluated_ positions for the _original_ points, but does not
match the size of evaluated geometry after constructive modifiers like
Line-Art. For the bounds the evaluated positions should be used as-is.

Pull Request: https://projects.blender.org/blender/blender/pulls/134325
2025-02-10 17:49:51 +01:00
Julian Eisel
ed0d01c5af UI: Remember scroll offset for tree-views
f0db870822 added support for tree-views to remember state, but only to
remember their custom height for the start. This change makes the scroll
offset be remembered too.

Not remembering the scroll offset can be very annoying in some cases,
e.g. when working with bone collections and changing the active tab in
the properties editor often. In realistic, non-trivial bone collection
set ups this can lead to a lot of repeated scrolling.

Cherry-picked for the 4.4 release since this solves a real usability
issue with trivial changes. Discussed with Thomas and others.
2025-02-10 17:43:53 +01:00
Brecht Van Lommel
d9ea0e0a29 Fix: Cycles oneAPI kernel not rebuilding when the compiler is updated
This is not a complete solution because there may be indirect changes
to the compiler other than the binary that require a rebuild, but this
should catch the simple cases at least.
2025-02-10 16:41:10 +01:00
Bastien Montagne
34b6faf85a I18N: Updated UI translations from git/weblate repository (61ec90aad9638d). 2025-02-10 16:31:56 +01:00
Janne Nylander
7451a1d016 Fix unreported: Grease Pencil "Add Masking Layer" operators duplicate check always returned nullptr
Original code used the wrong type of `BLI_findstring` function, leading
to the parameters being read incorrectly and the `MaskingLayer `duplicate
check working incorrectly.

This PR changed `BLI_findstring` to `BLI_findstring_ptr`, resulting in the
`LayerMask` names being read correctly and the duplcate check working
as expected.

Pull Request: https://projects.blender.org/blender/blender/pulls/134295
2025-02-10 16:25:29 +01:00
Clément Foucault
aad0bd2148 Fix #132889: EEVEE: Volumetric emission on zero scale mesh breaks render
The root cause is still unknown. But this patch disables
rendering of objects that will produce no volumetric effect.
This does fix the issue reported.
2025-02-10 16:17:15 +01:00
Clément Foucault
52e87d0fa3 Fix #134320: EEVEE: Crashes when leaving camera view back to orthographic
This happened because the interpolated winmat was degenerate.
Using a fallback matrix in this case to avoid a crash.
2025-02-10 15:21:51 +01:00
Bastien Montagne
7891089a2c RNA: Add 'save_copy' option to Image.save function.
Allows to save an image to a given path without updating the sourcepath
of the Image ID itself.
2025-02-10 15:05:06 +01:00
Patrick Mours
5810c94f95 Cycles: Add Blackwell to Cycles CUDA binaries architectures
Enables building of a Cubin for GPUs based on Blackwell architecture
if CUDA toolkit version 12.8 or higher is installed.
Only added sm_120 to the default set, since it is the one relevant for
consumer GPUs (RTX 5090 etc.) that are generally used with Blender.

Pull Request: https://projects.blender.org/blender/blender/pulls/134170
2025-02-10 14:55:28 +01:00
Bastien Montagne
1586b74262 Fix (unreported) crash when adding new image from UI.
The usual issue of non-trivial C++ data being allocated with C-style
`alloc` code.

Also added more default initializers to some generic RNA-related structs
that embded some `PointerRNA` members.
2025-02-10 14:15:15 +01:00
Sergey Sharybin
5437f22faf Fix unknown Cycles test device silently pass
Prevents situation when requested device is HIPRT (while the expected
spelling is HIP-RT).

Pull Request: https://projects.blender.org/blender/blender/pulls/134332
2025-02-10 14:13:42 +01:00
Clément Foucault
34216a2b7b Fix #134234: GPU: Shader Compile Error on with gpu.types.GPUShader
The removal of the loose uniform made the shader not compile.
This patch adds a new define for these type of shaders and add
back the loose uniform.

Note that these shaders might no longer work on Metal as
the source is not parsed anymore.

Pull Request: https://projects.blender.org/blender/blender/pulls/134341
2025-02-10 14:06:47 +01:00
Omar Emara
acfc8f2cc6 Fix #134293: Compositor crash after adding view layer
The compositor crashes when the active viewer layers is deleted and
replaced by a new layer. That's because the depsgraph of the compositor
still references the old view layer. To fix this, we need to update the
view layer of the compositor if it changed since it was last created.

Pull Request: https://projects.blender.org/blender/blender/pulls/134326
2025-02-10 13:09:03 +01:00
Omar Emara
d006924ebc Fix: Blur is two times slower in 4.4
The symmetric separate blur operation in the compositor is two times
slower in 4.4 compared to 4.3. On Linux, this only happens when Blender
is compiled with GCC, because Clang inlines a small function that GCC
doesn't.

To fix this, we specialize an if statement using templates to help GCC
inline the function. This results in a 3.5 times faster execution.

Pull Request: https://projects.blender.org/blender/blender/pulls/134336
2025-02-10 12:58:02 +01:00
Pratik Borhade
f75126a253 Fix #134284: Grease Pencil: Build modifier natural drawing speed fails
Natural drawing speed fails for strokes that are pasted or duplicated.
This is due to the `init_time` attribute being transferred from previous stroke
to the new, resulted in the same values. This further calculates wrong
`build_factor` inside `get_factor_from_draw_speed`. To further explain
this, `gap_delta_time = -prev_end_time` which evaluates `start_time=0` for
the duplicated curve. To avoid this situation, make sure `gap_delta_time`
is positive. So `start_time` will be > 0.

Pull Request: https://projects.blender.org/blender/blender/pulls/134329
2025-02-10 11:38:33 +01:00
Clément Foucault
5ccc02bbf4 Fix #78484: Overlay: No Wireframes in Edit Mode when Overlays are off
Added a mode check bypass for this particular case.
Added comments to explain reasoning.
2025-02-10 11:29:06 +01:00
Miguel Pozo
44d5d1b0f3 Fix #133638: Overlay-Next: X-Ray + Overlays
Alternative (cleaner) version of #134069.

Pull Request: https://projects.blender.org/blender/blender/pulls/134243
2025-02-10 10:48:59 +01:00
Philipp Oeser
351aef120f Fix #134286: Weight paint mirror ignores selection in face-select mode
Since the vert selection attribute should be in sync with face masking,
we can just enter the codepath for selected vertices here.

Pull Request: https://projects.blender.org/blender/blender/pulls/134327
2025-02-10 10:27:25 +01:00
Jonas Holzman
41bb42d374 macOS: Update x64 and arm64 libraries for 4.4
4.4 Library Changes Task: https://projects.blender.org/blender/blender/issues/128577

Pull Request: https://projects.blender.org/blender/blender/pulls/134301
2025-02-10 10:23:09 +01:00
Campbell Barton
4276437f05 Cleanup: quiet check_spelling_* warnings 2025-02-10 19:48:42 +11:00
John Kiril Swenson
6684eedba3 Fix: VSE: Standardize fake retiming key hotspot
`mouse_over_key_get_from_strip` doubled the hotspot for start and end
fake keys, but this was not reflected in the other use case of
`RETIME_KEY_MOUSEOVER_THRESHOLD`. Fix and add a comment for
documentation.
2025-02-09 23:23:44 -06:00
Jonas Holzman
567669d3ff Build: Remove unused PCRE dependency
OpenCollada used to rely on PCRE (a Perl Regexp library). Since
switching to Aras' OpenCollada fork (#122270), the library is no
longer needed, but is still required as a dependency.

This patch cleans this up by completely removing it from our build
system and linux system package installation script. This also lets
us remove it from our pre-compiled library platform repos, making the
process of recompiling our libraries from scratch easier as it wasn't
compiled by our dependency builder anymore.

Pull Request: https://projects.blender.org/blender/blender/pulls/134310
2025-02-10 01:22:56 +01:00
Ray Molenkamp
768b71b3c9 Deps: Move OIIO Patch to the right folder.
Made a mistake while copying over the fix from my buildbox
2025-02-09 11:18:40 -07:00
Ray Molenkamp
675bf068fe Deps: Include OIIO PR 4630
OIIO triggered some asserts in the debug configuration on windows
during file save, upstream PR 4630 is required to resolve these.
2025-02-09 10:40:15 -07:00
Ray Molenkamp
227750926d CMake: Windows add opencolorio to PLATFORM_ENV_BUILD_DIRS
required to run oiiotool during the tests.
2025-02-09 10:33:20 -07:00
Harley Acheson
41b1b4f95c Revert 867e9d879a: Status Bar Impossible Confirms & Cancels
As noted in #134241 this modal poll function cannot return false on an
item because there is a conflict in the way the operation is started
versus how it is set to cancel. Doing so also stops the escape key from
canceling the operator.

Pull Request: https://projects.blender.org/blender/blender/pulls/134273
2025-02-08 20:40:31 +01:00
Sebastian Parborg
ea380b1efe Revert "Sound: Sync up the screen refresh timer to the audio when seeking"
This reverts commit c952b12a6e.

This caused segfaults when playing back animations and seeking.
See #133542
2025-02-08 12:01:51 +01:00
Sean Kim
c83c981dab Assets: Update submodule hash
Related PR: blender/blender-assets#24

Pull Request: https://projects.blender.org/blender/blender/pulls/134250
2025-02-07 16:57:39 -08:00
YimingWu
9692c762c5 Fix #110853: UI: Support adjusting color picker with Trackpad
Adds the ability to change Color Picker HSL values with Trackpad using
MOUSEPAN.

Pull Request: https://projects.blender.org/blender/blender/pulls/110928
2025-02-07 23:52:06 +01:00
Sean Kim
1a603602e7 Assets: Update submodule hash
Related PR: blender/blender-assets#23

Pull Request: https://projects.blender.org/blender/blender/pulls/134247
2025-02-07 22:52:58 +01:00
Richard Antalik
b2660dbd2b Fix: Improve retiming speed get/set code precision
Use float for intermediate values when calculating speed or timeline
frames.

More details on precision improvement itself: In some cases, setting
strip speed to say 70% would result in actual speed being set to say
69.5%. With this change, the number would be closer or equal to 70%.

There few tangentially related changes:
- `SEQ_retiming_key_speed_get` was changed so both functions work in
  same time domain.
- `SEQ_retiming_key_speed_set` now expects speed as float factor
  instead of percentage. This is consistent with get function return
   value.
- Improve variable names, for better code readability.

Pull Request: https://projects.blender.org/blender/blender/pulls/131782
2025-02-07 22:41:18 +01:00
Brecht Van Lommel
f9c4ad1477 Build: Auto clear CMake cache variables for 4.4 library update
And remove some old checks that are no longer relevant.

Pull Request: https://projects.blender.org/blender/blender/pulls/134244
2025-02-07 21:23:58 +01:00
Brecht Van Lommel
fcc770390d Fix: Disable zlib in dpcpp to avoid linking to system library
Matching build options for regular LLVM.

Pull Request: https://projects.blender.org/blender/blender/pulls/134244
2025-02-07 21:23:58 +01:00
Brecht Van Lommel
d568867c80 Fix: SYCL library not found after recent library update
Pull Request: https://projects.blender.org/blender/blender/pulls/134244
2025-02-07 21:23:58 +01:00