Commit Graph

113977 Commits

Author SHA1 Message Date
Campbell Barton
e071bf4690 Fix #129607: Armature "Assign to Collection" crashes with defaults
Armature::collection_array was indexed with -1,
returning an invalid collection.

When the collection index isn't usable, create a new collection
with the default name.

Ref !129608
2024-11-05 23:00:31 +11:00
Campbell Barton
b53c20db25 EEVEE: remove DNA/RNA for values that are no longer in use
Remove values from EEVEE which are no longer used.

Ref !129832
2024-11-05 23:00:29 +11:00
Omar Emara
b3a603ff1e Revert "Fix: Blender crashes opening a file with compositor"
This reverts commit 0a70360eb6. That's
because it caused issue #129366 which is much more serious, and the
cause is not obvious so far. Another fix will be submitted for the
original issue.
2024-11-05 13:55:48 +02:00
Jeroen Bakker
b18a460ad7 Fix #129265: Clearing depth attachments on AMD official driver
When using AMD official driver clearing depth attachments can fail.
I assume it is related to previous pipeline states and dynamic rendering
that don't require the correct pipeline state for clearing depth
attachments.

![image](/attachments/e5b97c3b-2551-4600-8cbe-4c8fc71d9feb)

Co-authored-by: jeroen@blender.org <Jeroen Bakker>
Pull Request: https://projects.blender.org/blender/blender/pulls/129852
2024-11-05 12:44:17 +01:00
Bastien Montagne
6ba58a8303 Fix (unreported) unclear potential invalid readfile behavior on unknown BHead type.
This was likely never an issue so far, as no ID type has ever been
removed (that was written in blendfiles at least), and no new BHead type
has been added since ages.

However, current behavior of the main loop in the readfile code (in
`blo_read_file_internal`) is to consider any BHead type which is not
explicitely known and handled, to be an ID BHead, and directly try to
load it as such.

This commit addresses that potential issue by validating that a BHead
code actually matches a known ID type before trying to use it to read an
ID from the file.

Issue identified while working on designs for future 5.0 forward
compatibility breaking changes in blendfile format itself.

Pull Request: https://projects.blender.org/blender/blender/pulls/129693
2024-11-05 12:26:25 +01:00
Philipp Oeser
a3b04dffbc Fix #129798: GPv3: Selection to Cursor/Grid missing immediate update
Missing in db1443249c.

Need to tag positions as changed.
Also send `ND_DRAW` notifier to be sure we fully redraw (makes e.g.
gizmos update accordingly as well).

Pull Request: https://projects.blender.org/blender/blender/pulls/129848
2024-11-05 11:12:22 +01:00
Iliya Katueshenock
74f98b1e92 Fix: Geometry Nodes: crash when converting layers to instances
The crash/assert happened because the case when there are instances already was not handled.

Pull Request: https://projects.blender.org/blender/blender/pulls/127299
2024-11-05 11:05:28 +01:00
Marco Rotili
5c572f01cf Fix #129461: Sample index geometry node does not support Grease Pencil
The sample index node specifies the supported geometry types and Grease
Pencil was missing. Note that only the layer domain will work since it's
the only domain accessible by index on GP data directly.

Pull Request: https://projects.blender.org/blender/blender/pulls/129758
2024-11-05 10:00:41 +01:00
Christoph Lendenfeld
103f494062 Fix #129589: Crash when pushing down NLA track
The issue is that the action line may be there, but containing no action,
`bAnimListElem->data` pointer is a nullptr.

caused by b952782a44
In this refactor the function call was changed from
`BKE_action_frame_range_get` which could handle
the case of a nullptr passed to it.

Pull Request: https://projects.blender.org/blender/blender/pulls/129648
2024-11-05 09:38:51 +01:00
Jeroen Bakker
f76410329b Vulkan: Disable Optimizations for Qualcomm
Qualcomm driver can not handle the optimized SPIR-V that Blender
creates. According to their driver engineers this is an issue in
shaderc. As we are late in the release process they asked us to disable
the optimizations.

In Blender 4.4 we are planning to update shaderc what might fix the
issue. This should be retested after the update.

Pull Request: https://projects.blender.org/blender/blender/pulls/129775
2024-11-05 08:05:42 +01:00
Campbell Barton
007fd95f17 Fix #129578: Crash setting pose mode using Context.temp_override(..) 2024-11-05 13:56:59 +11:00
Richard Antalik
8c3b734560 Fix #129406: Crash on copy to selected for scene input property
RNA update function called from `rna_property_override_apply_default`
does not have access to active `Scene`, so it is explicitly set to null.

Use `ptr->owner_id` instead of scene provided in argument.

Pull Request: https://projects.blender.org/blender/blender/pulls/129562
2024-11-05 03:54:57 +01:00
Hans Goudey
10e6fee4ef Fix: Skip mixing enum/reference index attributes in simulation bake
Interpolating these attributes as integer values isn't meaningful or
helpful and is potentially problematic. So far I'd guess this is unlikely
to happen in practice which is why it probably hasn't been noticed yet.

Fixes part of #129691.

Pull Request: https://projects.blender.org/blender/blender/pulls/129809
2024-11-04 20:15:35 +01:00
Sean Kim
426ed8c61e Fix #129425: Using Voxel Remesh in sculpt mode can crash
When using the Voxel Remesh operator, there are two possible sources of
crashes currently:
* TBB task stealing in nested parallel loops with thread local data
* Null dereference of PBVH data when pushing sculpt undo steps

To fix the former issue, this commit guards the
`threading::parallel_for` internal function with
`threading::isolate_task` to prevent possible task stealing and
corruption of the thread local data.

Additionally, it has the effect of fixing debug asserts inside
`array_utils::gather` due to the this task stealing.

To fix the latter issue, this commit adds a call to
`BKE_sculpt_update_object_for_edit` to ensure that this data is
populated.

Pull Request: https://projects.blender.org/blender/blender/pulls/129704
2024-11-04 19:50:34 +01:00
Clément Foucault
1bf2b9a0f7 Fix: EEVEE: VR not working
The issue is caused by the new way to compute the projection
matrix that tries to recreate it from view3d properties.
This is needed for proper overscan support.

However, this breaks for VR as the view3d is only partially
setup.

Skip the setup in VR and remove overscan for VR to avoid any
possible issues with it.

This fix avoid changing the behavior of the
`ED_view3d_draw_offscreen` which is exposed from our pyGPU
API. The pyGPU API is kind of broken if using custom
projection matrix + overscan, but that's a different issue.

Fix #125456

Pull Request: https://projects.blender.org/blender/blender/pulls/129813
2024-11-04 19:39:36 +01:00
Sean Kim
ac4570dd55 Fix: Potential data corruption with face set updates
Using array_utils::gather inside an already parallel context with TLS
variables has the possibility of causing data corruption due to task
stealing.

This commit changes them to the sculpt specific gather_mesh_data call
to avoid the nested parallel loop issue.

Pull Request: https://projects.blender.org/blender/blender/pulls/129770
2024-11-04 18:28:32 +01:00
Clément Foucault
b1185a4736 Fix: EEVEE: Volume probe bad shading if resolution is divisible by 3
This was caused by uninitialized values at border. The correct
number of bricks were reserved but only the unpadded volume
was uploaded. Which was not touching the data of the border
bricks if the size was divisible by `IRRADIANCE_GRID_BRICK_SIZE - 1`.

Fix #127215

Pull Request: https://projects.blender.org/blender/blender/pulls/129810
2024-11-04 17:48:23 +01:00
Pratik Borhade
7a19fe8f97 Fix #129543: GPv3: Set new group active
Similar to layers when new group is added, mark that group as active.

Pull Request: https://projects.blender.org/blender/blender/pulls/129785
2024-11-04 17:08:40 +01:00
Sybren A. Stüvel
822907a68d Fix #127293: GPv3: Show regular keyframes Dope Sheet for GP object data
In the Dope Sheet, show regular keyframes for GreasePencil object data.
The GPv3 transition missed a few cases in the animation
channel/filtering code to add the channels from regular Actions on
GreasePencil data blocks.

Pull Request: https://projects.blender.org/blender/blender/pulls/129807
2024-11-04 17:03:19 +01:00
Philipp Oeser
bdfb3ea6e7 Fix #129727: GPv3: renaming bones does not rename vertex groups
First issue is that `BKE_modifiers_uses_armature` wasnt working for GP
objects and the second one is that vgroup names are stored in
CurvesGeometry for GP (so that needs special handling, now done, same as
in `BKE_object_defgroup_set_name`).

Pull Request: https://projects.blender.org/blender/blender/pulls/129794
2024-11-04 17:00:51 +01:00
Sybren A. Stüvel
6f0cd39eab Fix: GPv3: Crash in transform snapping code
Fix a crash in transform snapping code, where NLA retiming was attempted
on Grease Pencil frames.

Pull Request: https://projects.blender.org/blender/blender/pulls/129808
2024-11-04 16:44:18 +01:00
Omar Emara
a1b489ec71 Fix #129670: Curves not drawn outside of clip range
Curve maps in nodes like RGB Curves are not drawn nor evaluated outside
of clipping range. This is a regression in 8812be59a4, where the range
of the curve didn't account for points that lie outside of the clipping
range. That's because the table_range variable was initialized before
the loop that updates the minimum and maximum points of the table.

To fix this, we move the table_range initialization after the loop that
updates the minimum and maximum points of the table.

Pull Request: https://projects.blender.org/blender/blender/pulls/129777
2024-11-04 16:11:43 +01:00
YimingWu
ecba71ae91 Fix #129738: GPv3: Build modifier use key frame
Build modifier should start building strokes at a key frame, not always
assume a starting frame of 0.

Frame restriction works the same way as GPv2, which uses absolute
frame number.

Pull Request: https://projects.blender.org/blender/blender/pulls/129774
2024-11-04 15:33:11 +01:00
Pratik Borhade
f6bd812c68 Fix #129671: GPv3: Cut tool not respecting material lock setting
Instead of looping over entire curve range, get editable stroke mask to
iterate on curves for finding out whether they intersect with lasso gesture.

Pull Request: https://projects.blender.org/blender/blender/pulls/129714
2024-11-04 14:04:18 +01:00
Pratik Borhade
d943c9f128 Fix #128831: GPv3: Crash when adding action track
When grease pencil has no actions (ale->adt), id data block channel is
still added due to `ANIMFILTER_ANIMDATA`. This would lead to crash if
operator is accessing the AnimData (ale->adt). To fix this, make sure
adt exists before creating an animchannel.

Pull Request: https://projects.blender.org/blender/blender/pulls/128841
2024-11-04 17:59:26 +05:30
Falk David
df0c567380 Fix #129781: GPv3: Memory leak in the edit batch cache
Introduced by 5fff95f519.
The commit forgot to free the `cache->edit_points_vflag`.
The fix frees the buffer in `grease_pencil_batch_cache_clear`.

Pull Request: https://projects.blender.org/blender/blender/pulls/129786
2024-11-04 12:13:04 +01:00
Hans Goudey
af58c223a4 Fix #129598: Resample curves node missing type alignment handling
The 4x4 matrix type has a larger alignment requirement of 16 bytes
than the default, but it was stored in a generic vector of bytes. There
are a few solutions that reduce the memory reuse in this code path--
the chosen solution uses a custom allocator which always allocates
with an alignment that should be large enough for anything.

Generally I think this resampling loop could be rewritten to be a bit
simpler, avoiding these problems in the first place. Some performance
testing would show whether this "fancy" memory use between types
and loop structure is actually worth it. For now though, just correcting
the existing logic seems like the best choice.

Pull Request: https://projects.blender.org/blender/blender/pulls/129628
2024-11-04 11:44:06 +01:00
Damien Picard
edcc5e0e87 I18n: Translate and disambiguate a few messages
Translate
- Extract Grease Pencil modifier subpanel header messages.

Disambiguate
- Integer Math node operation (same as other existing math nodes).

Pull Request: https://projects.blender.org/blender/blender/pulls/128715
2024-11-04 11:15:48 +01:00
Marco Rotili
b6481372b9 Fix #129629: Crash when applying Geometry Nodes modifier on all keyframes on a Grease Pencil object
The input `md_eval` is invalidated when calling `BKE_scene_graph_update_for_newframe`.

The fix uses `BKE_modifier_get_original` to pass the original modifier
to `apply_grease_pencil_for_modifier_all_keyframes` then calls `BKE_modifier_get_evaluated`
after `BKE_scene_graph_update_for_newframe` to ensure the `md_eval` pointer is valid.

Pull Request: https://projects.blender.org/blender/blender/pulls/129732
2024-11-04 10:38:46 +01:00
Jesse Yurkovich
673f6dbb7f Fix #129725: Handle case of no animation keys during Collada export
Regression from 629b3ccd42

Guard against `BKE_key_from_object` returning null.

Pull Request: https://projects.blender.org/blender/blender/pulls/129760
2024-11-04 05:28:36 +01:00
Jesse Yurkovich
60d88f46ba Fix: STL import crash when unable to open or read file
Regression from d1455c4138

Ensure we return from `importer_main` if no mesh could be loaded with
`read_stl_file` (e.g. `bpy.ops.wm.stl_import(filepath="<nope>")`)

Pull Request: https://projects.blender.org/blender/blender/pulls/129759
2024-11-04 04:38:15 +01:00
Richard Antalik
2a32b26415 Fix: VSE: Use after free in retiming
Caused by incorrectly initializing temporary range of `for` loop.

Pull Request: https://projects.blender.org/blender/blender/pulls/129659
2024-11-04 03:16:13 +01:00
Campbell Barton
02571da35f PyDoc: correct GPUIndexBuf doc-string & exception 2024-11-04 11:55:41 +11:00
Campbell Barton
3bab869c0d Fix BMeshElemSeq.sort(key=None) argument
Allow passing key=None to BMesh element sorting callback,
matching the doc-string & Python's list sort.
2024-11-04 11:55:37 +11:00
Sean Kim
43bbd9fd2d Fix: Paint: Unified strength value should be off by default
Introduced in 1bc5c488d4

The value used in DNA_scene_defaults.h was out of sync with the actual
default startup value. In all currently supported and in development
versions (3.6 LTS, 4.2 LTS, 4.3, and 4.4), the `UNIFIED_PAINT_ALPHA`
bit value is set to false.

Pull Request: https://projects.blender.org/blender/blender/pulls/129711
2024-11-04 00:07:29 +01:00
Campbell Barton
470173bbc4 PyDoc: use keyword only specifier for bpy.props & bpy.ops 2024-11-03 21:50:33 +11:00
Campbell Barton
091ee2833b PyDoc: replace references to the deprecated "bgl" with "gpu"
Also correct bullet-points in gpu.state.blend_set.
2024-11-03 21:50:33 +11:00
Campbell Barton
b00550916c PyDoc: correct use of single back-ticks 2024-11-03 21:50:33 +11:00
Campbell Barton
3bcfb151c1 PyDoc: use Python's type annotation syntax for doc-strings
Replace plain-text type information with the type syntax used
for Python's type annotations as it's more concise, especially for
callbacks which often didn't include useful type information.

Note that this change only applies to inline doc-strings,
generated doc-strings from RNA need to be updated separately.

Details:

- Many minor corrections were made when "list" was incorrectly used
  instead of "sequence".
- Some type information wasn't defined in the doc-strings and has been
  added.
- Verbose type info would benefit from support for type aliases.
2024-11-03 15:44:35 +11:00
Leon Schittek
3347aa4017 Fix: Geometry Nodes: Matrix socket not connecting after link-drag search
Ensure the matrix socket is made available, when connecting to it via
the link-drag search.

Pull Request: https://projects.blender.org/blender/blender/pulls/129713
2024-11-02 17:03:42 +01:00
Jacques Lucke
0c2a70e970 Fix: crash using Edit Minimum Distance operator
This fixes two crashes related to freeing the operator data incorrectly and too early.
2024-11-02 12:17:41 +01:00
Campbell Barton
a05345e139 PyDoc: various corrections to function doc-strings
Add missing arguments, corrections & remove unchecked type info.
2024-11-02 17:48:21 +11:00
Campbell Barton
4df285ccd5 Cleanup: move function comments into headers or implementation notes
For C/C++ doc-strings should be located in headers,
move function comments into the headers, in some cases merging
with existing doc-strings, in other cases, moving implementation
notes into the function body.
2024-11-02 17:27:09 +11:00
Campbell Barton
c5222a3953 Cleanup: quiet variable unused warning 2024-11-02 15:43:29 +11:00
Campbell Barton
99387c0749 Cleanup: spelling in comments, docs & error 2024-11-02 15:43:27 +11:00
Campbell Barton
e7e6bf1dfe Fix memory leak in mathutils.geometry.box_pack_2d
The set macro doesn't handle the reference count for existing values.
2024-11-02 15:08:42 +11:00
Hans Goudey
c38484107f Fix #129697: Crash renaming node interface input to empty string
Caused by trying to construct a `std::string` from `nullptr`.
2024-11-01 21:27:25 +01:00
Sean Kim
8151105e24 Fix #129645: Sculpt color attribute popover never active
With the brush assets project, many paint tools are no longer specified
by tool. To maintain functionality, this commit inspects the brush type
instead of hardcoding against the paint tool to ensure that no matter
which tool is being used, the UI displays correctly based on the brush.

Pull Request: https://projects.blender.org/blender/blender/pulls/129654
2024-11-01 19:23:16 +01:00
Julian Eisel
a859ed1130 Fix: All asset library not refreshed as available libraries change
Fixes #128751.

As asset libraries were added or removed (through the UI or BPY), the
"All" asset library wouldn't refresh to reflect the changes. In general
this wasn't handled well. Even a manual refresh wouldn't give the right
result.

There were multiple issues really:
- Only the first load of the "All" library would query the preferences
  for the available libraries. Further loads would only refresh the
  catalogs, ignoring any added/removed libraries.
- Operators and BPY functions didn't clear the asset libraries to
  enforce a re-fetch.
- When clearing an asset library, the "All" library wasn't cleared in
  some cases, it would show the old state still.
- The API function to clear an asset library's asset list would not
  clear the storage of asset browsers so they wouldn't refresh. It makes
  no sense to only do one, so let the API handle both cases.

The way we handle asset library updating could be improved generally,
and be more internal to the asset system. For now this explicit clearing
seems fine.

We also need to handle removal of libraries better still, I think they
remain in memory.

Pull Request: https://projects.blender.org/blender/blender/pulls/129541
2024-11-01 18:02:54 +01:00
Julian Eisel
a641001207 Fix: UI previews don't refresh outside of properties editor
The preview template (`UILayout.template_preview()`) to display previews
for materials, textures or similar would only work correctly in the
Properties editor. This had explicit logic to trigger rerendering on
changes. When displaying such previews elsewhere (e.g. in the 3D View
sidebar), the only way to have changes reflected would be by resizing
the preview.

This fix makes sure such previews are tagged as dirty and refreshed on
changes to the underlying ID. We do this the same way as tagging the ID
previews as dirty, through a function called by the dependency graph for
such updates.

Pull Request: https://projects.blender.org/blender/blender/pulls/129641
2024-11-01 15:25:24 +01:00