Commit Graph

146423 Commits

Author SHA1 Message Date
Aaron Carlisle
fe5e712edc Merge branch 'blender-v4.4-release' 2025-02-11 18:47:28 -05:00
Aaron Carlisle
4906d8bf85 Fix: new/free mismatch
See 06be295946
2025-02-11 18:45:31 -05:00
Harley Acheson
c663b78bcb Refactor: Tooltip Calculation of Sizing and Spacing
Refactor how tooltips are sized, items placed, margins calculated, etc.
Current code has some mistakes that we use kludges to compensate for,
and it doesn't properly consider the font size in calculating margins.
The result shown to users in normal circumstances (changing resolution
scale only) with this PR applied should look identical to current.
Small changes when the text style size is changed. However, this is
mostly to allow later adjustments to padding, which currently _breaks_
when changed.

Pull Request: https://projects.blender.org/blender/blender/pulls/134205
2025-02-12 00:09:02 +01:00
Harley Acheson
9e1d038b1e Merge branch 'blender-v4.4-release' 2025-02-11 14:32:02 -08:00
Gilberto.R
b5b786b34f Fix: UI: Close pie menu on window focus loss
Close open pie menus on window loss of focus, to prevent waiting for
the pie key release if it was released outside of focus.

Pull Request: https://projects.blender.org/blender/blender/pulls/134215
2025-02-11 23:30:31 +01:00
Sean Kim
a2b75c87c8 Merge branch 'blender-v4.4-release' 2025-02-11 14:10:10 -08:00
Sean Kim
312579ce82 Fix #134366: object.closest_point_on_mesh always returns no result
Introduced in 024d7d12e2

Pull Request: https://projects.blender.org/blender/blender/pulls/134377
2025-02-11 23:09:20 +01:00
Sergey Sharybin
a535a1a027 Fix #132782: MetalRT: Missing Geometry in Cycles preview on MacOS 15.2
The issue also happens on macOS 15.3.

This is a Metal driver bug, a fix is coming in macOS 15.4. Until then
disable refitting the viewport. There is no perceptible benefit from
refitting, so while it might be less that ideal it allows to side step
the problem and still benefit from the HWRT.

Pull Request: https://projects.blender.org/blender/blender/pulls/134399
2025-02-11 21:42:38 +01:00
Brecht Van Lommel
2c34786474 Merge branch 'blender-v4.4-release' 2025-02-11 20:43:17 +01:00
Brecht Van Lommel
529ce46744 Fix: Cycles silently ignores unknown --cycles--device type
Pull Request: https://projects.blender.org/blender/blender/pulls/134354
2025-02-11 20:42:21 +01:00
Brecht Van Lommel
9ad19396f5 Fix: Cycles Metal invalid storage mode check
Pull Request: https://projects.blender.org/blender/blender/pulls/134337
2025-02-11 20:42:01 +01:00
Brecht Van Lommel
d8a02dc435 Tests: Update Storm reference renders for USD 25.02 and MaterialX 1.39
Pull Request: https://projects.blender.org/blender/blender/pulls/134411
2025-02-11 20:40:33 +01:00
Brecht Van Lommel
89e3d0a688 Fix: MaterialX normal map node not exported
Space input was removed in MaterialX 1.39.

Pull Request: https://projects.blender.org/blender/blender/pulls/134411
2025-02-11 20:40:33 +01:00
Brecht Van Lommel
21da1aec16 Fix: MaterialX of gradient texture node is wrong
Node input names changes in MaterialX 1.39.

Pull Request: https://projects.blender.org/blender/blender/pulls/134411
2025-02-11 20:40:33 +01:00
Brecht Van Lommel
77a7c68c9d Fix: Hydra exoports incorrect dome light color
It would both set the dome light color and export a texture with that
same color, which would double up. It was also using the World.exposure
member which is not used anywhere else in Blender.

Pull Request: https://projects.blender.org/blender/blender/pulls/134411
2025-02-11 20:40:33 +01:00
Brecht Van Lommel
1d743e2082 Fix: USD exports icnorrect dome light color when not using nodes
Implement support for this.

Pull Request: https://projects.blender.org/blender/blender/pulls/134411
2025-02-11 20:40:33 +01:00
Maxime-Cots
bbab2aa328 Add default Plane shape to USD Importer
Implement the USD Plane Shape for import, mirroring what was done for
the others. See #134138

Additional tests will be added afterwards but a simple test is simply to
import the resulting file:
```python
from pxr import Usd, UsdGeom
stage = Usd.Stage.CreateNew('plane.usd')
xform_prim = UsdGeom.Xform.Define(stage, '/world')
plane_prim = UsdGeom.Plane.Define(stage, '/world/plane')
stage.GetRootLayer().Save()
```

Co-authored-by: Nig3l <nig3lpro@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/134275
2025-02-11 19:56:15 +01:00
Clément Foucault
db2610f2e4 DRW: Use new gpu::TexturePool inside TextureFromPool
Follow up to #134403.
2025-02-11 19:00:43 +01:00
Clément Foucault
6138ee64a9 GPU: TexturePool: Add texture pool functionality to the GPU module
This patch adds the texture pool functionality that was previously
only available in the DRW module to the GPU module.

This allows to not rely on global `DST` variable for the managment
of these temporary textures.

Moreover, this can be extended using dedicated GPU backend
specific behavior to reduce the amount of memory needed
to render.

The implementation is mostly copy pasted from the draw implementation
but with more documentation. Also it is simplified since the
`DRW_texture_pool_query` functionality is not needed.

Pull Request: https://projects.blender.org/blender/blender/pulls/134403
2025-02-11 18:58:46 +01:00
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
Hans Goudey
638609752c Fix #134290: Multi-editing crash after recent refactor
Another case of C-style allocation of non-trivial objects hidden
with casting. To fix, give explicit member defaults to a few of
the UI interaction structs.
2025-02-11 12:41:18 -05:00
Jacques Lucke
4980dc5e29 Merge branch 'blender-v4.4-release' 2025-02-11 17:47:45 +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
374604f188 Refactor: Core: simplify accessing ListBases in Main
This replaces the `set_listbasepointers` function with `BKE_main_lists_get`
which returns an array of `ListBase *`. This simplifies the caller a bit. In
some cases, it can be simplifed further by changing the order in which we iterate
over the listbase. For historical reasons, we iterate from the back to front in
most cases but sometimes the order does not matter. I did keep the iteration order
in this patch though, to avoid regressions.

Pull Request: https://projects.blender.org/blender/blender/pulls/134242
2025-02-11 17:46:07 +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
Brecht Van Lommel
21a90f26b6 Cleanup: Fix C++20 deprecation warnings in Cycles
Pull Request: https://projects.blender.org/blender/blender/pulls/134338
2025-02-11 16:42:03 +01:00
IREXTIA
43b3c62a54 UI: Improve save report message
Currently, all save operations show the same `Saved "Filed.blend"` message.

Improve wording to tell apart different save actions such as:

* Save As
* Save Copy
* Save Incremental

Pull Request: https://projects.blender.org/blender/blender/pulls/134114
2025-02-11 16:39:12 +01:00
Omar Emara
13733423df Merge branch 'blender-v4.4-release' 2025-02-11 16:37:30 +02: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
1076ec7522 Merge branch 'blender-v4.4-release' 2025-02-11 14:57:30 +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
Bastien Montagne
e55d478c64 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:45:22 +01:00
Omar Emara
51789af3cb Cleanup: Compositor: Remove is_int_type method
The method is only used in one place and will be redundant in a future
change.
2025-02-11 14:29:52 +02:00
Clément Foucault
144045cf63 Cleanup: DRW: Remove unused options 2025-02-11 13:03:00 +01:00
Clément Foucault
9bded245cc Cleanup: DRW: Remove global access function DRW_viewport_pixelsize_get 2025-02-11 13:02:54 +01:00
Clément Foucault
09e7e878e6 Cleanup: DRW: Remove unused legacy DRWViewport*List 2025-02-11 12:58:32 +01:00
Clément Foucault
ff34648011 Grease Pencil: Merge GPENCIL_PrivateData into GPENCIL_Instance
No functional change. Simplify architecture.
2025-02-11 12:56:00 +01:00
Clément Foucault
623c81c7ec Fix: GPU: Broken gizmo color
Some unrelated change was brought back inside
86b70143d5

Revert the offending change.
2025-02-11 12:54:20 +01:00
Falk David
bf072eeb08 Fix: Grease Pencil: Mask icon for layer groups is not correct
This was probably caused by 3ef2ee7c53.
Now `build_layer_group_buttons` doens't need to
select a specific icon anymore. It's handled by the
RNA property.
2025-02-11 12:26:43 +01:00
Clément Foucault
95305b2dc5 Fix: SelectID: Broken shader compilation on Metal 2025-02-11 12:19:23 +01:00
Lukas Tönne
d01f2e232b Fix ASAN warnings in node socket forward compatibility code
These are due to casting a nullptr to an `ID`, which is valid but
confuses ASAN. `reinterpret_cast` avoids this.

Pull Request: https://projects.blender.org/blender/blender/pulls/134386
2025-02-11 12:15:54 +01:00
Sebastian Parborg
fec27eded6 Merge branch 'blender-v4.4-release' 2025-02-11 11:40:41 +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
d251081448 Merge branch 'blender-v4.4-release' 2025-02-11 21:33:07 +11: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
Falk David
4229d7fa65 Grease Pencil: Python: Add next/prev_node to GreasePencilTreeNode
This adds two properties `next_node` and `prev_node` to the
`GreasePencilTreeNode` RNA struct.

This reflects how the tree nodes are stored in DNA (as a linked list).

Pull Request: https://projects.blender.org/blender/blender/pulls/134353
2025-02-11 10:32:48 +01:00
Campbell Barton
10b2ac174a Merge branch 'blender-v4.4-release' 2025-02-11 18:33:58 +11:00
Campbell Barton
29076ebd75 UI: avoid potential error accessing freed memory 2025-02-11 17:21:02 +11:00