Commit Graph

117289 Commits

Author SHA1 Message Date
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
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
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
Campbell Barton
968909d57c Cleanup: rename RNA parameter to clarify its meaning
This flag is only used when classes are registered,
avoid confusion by renaming to `PARM_PYFUNC_REGISTER_OPTIONAL`.
2025-02-11 16:31:42 +11:00
Campbell Barton
9f84c6beb6 Cleanup: remove redundant use of PARM_PYFUNC_OPTIONAL
This is only used for registration, as long as PARM_REQUIRED isn't set
function arguments are assumed to be optional.
2025-02-11 16:14:54 +11:00
Campbell Barton
df24ef3dee Cleanup: remove unused function 2025-02-11 13:43:57 +11:00
Clément Foucault
ad7b8d5b4c Metal: Ensure that storage buffer reads are synchronized on Intel Macs
There seems to be a pattern where this commonly failed.

This patch adds the async flush (which is effectively not async)
when there were no previous call to `async_flush_to_host`.
This is only done on Intel Macs (or any mac that has non
unified memory arch).

Pull Request: https://projects.blender.org/blender/blender/pulls/134216
2025-02-10 20:44:08 +01:00
Sean Kim
08e53db413 Merge branch 'blender-v4.4-release' 2025-02-10 09:55:13 -08: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
Hans Goudey
7ab3087751 Cleanup: Remove unused CMake dependencies for CSV import 2025-02-10 12:23:50 -05:00
Hans Goudey
f01af5f972 Geometry Nodes: Remove extra copy step in CSV import node
Remove intermediate `CsvData` struct and create a point cloud
directly instead. Though the bottleneck is almost certainly parsing
the file, this removes a copy for the attribute values and reduces
peak memory usage.

Also do some small cleanups to the import process: use C++
casting, prefer StringRef over std::string, remove unnecessary
whitespace, and remove non-helpul comments.
2025-02-10 12:19:45 -05:00
Hans Goudey
78da0dda87 Cleanup: Warning in format string in CSV importer 2025-02-10 12:19:45 -05:00
Hans Goudey
ef8e85c436 Cleanup: Remove unnecessary indirection in CSV importer 2025-02-10 12:19:45 -05:00
Hans Goudey
7605382204 Cleanup: Include in CSV import header 2025-02-10 12:19:45 -05:00
Clément Foucault
a961c9050d Cleanup: GPU: Remove dependency on legacy common_math_lib.glsl
Replace usage of `common_math_lib.glsl` (deprecated) with gpu shader libs.

Pull Request: https://projects.blender.org/blender/blender/pulls/131579
2025-02-10 18:14:50 +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
Falk David
3ef2ee7c53 Grease Pencil: Python: Add base class for layer and layer groups
This adds a base class for `GreasePencilLayer` and
`GreasePencilLayerGroup` called `GreasePencilTreeNode`.

This reflects how the data is structured in DNA. Properties
that are shared among layers and groups are part of the
tree nodes. Examples are `name`, `hide`, `select`, etc.

This should not be a breaking change. Addons are expected
to work as they were before.

With this change, layer groups now also have access to the
`channel_color` and `select` property.

Pull Request: https://projects.blender.org/blender/blender/pulls/134348
2025-02-10 17:56:19 +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
Clément Foucault
86b70143d5 Cleanup: GPU: Remove unused Transform Feedback implementation
Most of the cleanup is inside the metal backend.

Pull Request: https://projects.blender.org/blender/blender/pulls/134349
2025-02-10 17:30:42 +01:00
Devashish Lal
1a62fdc82a Geometry Nodes: CSV import node
This commit implements a node to import CSV files as a point cloud.
The interface is minimal, with just a file path input. The type of each
column is chosen by whether the first value is an integer or a float
(those are currently the only supported types).

The goal of the node is to make it easier to get arbitrary data into
geometry nodes for visualization purposes, for example.

https://devtalk.blender.org/t/gsoc-2024-geometry-nodes-file-import-nodes/34482

Pull Request: https://projects.blender.org/blender/blender/pulls/126308
2025-02-10 16:56:52 +01:00
Falk David
3c075a6c56 Merge branch 'blender-v4.4-release' 2025-02-10 16:26:11 +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
96174e76ed Merge branch 'blender-v4.4-release' 2025-02-10 16:17:38 +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
Aras Pranckevicius
4f0fd32d6f VSE: Over Drop effect was not doing anything useful, map it to Alpha Over
Behavior of it was exactly the same as Alpha Over for the last 18 years (since
327d413eb3 in 2006 March), so just remap it to regular alpha over on file read.

Pull Request: https://projects.blender.org/blender/blender/pulls/134342
2025-02-10 16:10:01 +01:00
Julian Eisel
e2b1f1f818 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.
2025-02-10 15:56:10 +01:00
Clément Foucault
6e0bd843d8 Merge branch 'blender-v4.4-release' 2025-02-10 15:22:39 +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
b3bf5bf43e Merge branch 'blender-v4.4-release' 2025-02-10 15:05:32 +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
Bastien Montagne
4b996baa76 Merge branch 'blender-v4.4-release' 2025-02-10 14:16:47 +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