Commit Graph

120055 Commits

Author SHA1 Message Date
Brecht Van Lommel
f6eb81e62a Cleanup: Fix (harmless) null pointer increment in particle code 2025-03-06 22:34:22 +01:00
Falk David
e39c83c881 Merge branch 'blender-v4.4-release' 2025-03-06 21:19:31 +01:00
John Kiril Swenson
993f9b2d30 VSE: Report one-time property changes
This patch adds warnings when view transform or FPS values are changed
by dragging in an initial strip with "Set Scene Frame Rate" or "Set View
Transform" enabled.

In the case that both occur at the same time, reports are not
interweaved but both still show up in the info viewer -- this is a
limitation of `BKE_report` itself. Future work could modify the report
system to support queuing, but this is still an improvement over
previous behavior.

Pull Request: https://projects.blender.org/blender/blender/pulls/135494
2025-03-06 21:13:12 +01:00
Jesse Yurkovich
0a16ba9911 Fix #135502: Handle Alembic attribute size mismatch when reading points
The Alembic file in the issue had 0 points, and 4 widths, defined for
frame 33 which is certainly incorrect from whichever software produced
said file. However, our import code should have proper guards in place
to more gracefully handle the situation.

Pull Request: https://projects.blender.org/blender/blender/pulls/135548
2025-03-06 20:54:53 +01:00
Jesse Yurkovich
3a0e4fe316 Fix #134039: Alembic procedural proxy mesh should be owned by GeometrySet
When using Alembic procedurals, the Mesh Sequence Cache attempts to
replace the original geometry with a plain old cube. However, it never
frees this new cube geometry. Transfer ownership to the underlying
GeometrySet instead.

Investigating the scenario also showed that the `~AlembicProcedural`
dtor was removing an item from the `nodes` vector while iterating over
it, which triggers debug asserts on at least MSVC. I believe the removal
is unnecessary since this is the dtor and ASAN appears clean now.

Pull Request: https://projects.blender.org/blender/blender/pulls/134085
2025-03-06 20:53:52 +01:00
Clément Foucault
2131ef0a20 DRW: Use depsgraph update count to replace view_update
This avoid having to flush explicitely and the need for syncing.
It also removes a lot of complexity in the process.

These updates are not granular and do not need to so much
boiler plate code.

The depsgraph update counter now becomes atomic to avoid
undefined behavior when a depsgraph is being destroyed and
its memory reused (same thinking as the non-copy-on-eval IDs).

I tested some use cases (object update, sculpt update,
shading update) and they are all working.

Pull Request: https://projects.blender.org/blender/blender/pulls/135580
2025-03-06 19:15:29 +01:00
Julian Eisel
b9907cb60b Fix #134418: Double clicking a file crashes Blender if load UI is off
Screen initialization is more context dependent than it used to be
because of region polling, so the context needs to be set up correctly.
Here was a case where the initialized window/screen passed to polling
didn't match what's in context (UI context was unset in fact).

Some asserts could be added to ensure data passed to screen
initialization matches context, but can do that separately.

Pull Request: https://projects.blender.org/blender/blender/pulls/135568
2025-03-06 19:01:10 +01:00
Clément Foucault
b4a1a140d7 Fix #134509: GPU: Node editor links are invisible on Intel GPU
This bug also affects integrated GPU as well.
Remove the GPU familly check.
2025-03-06 18:48:56 +01:00
Hans Goudey
9287bb759b Geometry Nodes: Import Text node
As a small addition to the import node features for 4.5,
this simple node imports a text file as a string. Potential
use cases include retrieving text for motion graphics.

Currently this just allows .txt files. More extensions could
be allowed in the future.

Pull Request: https://projects.blender.org/blender/blender/pulls/135459
2025-03-06 18:47:30 +01:00
Hans Goudey
4fd96e61d5 Fix: Missing cache invalidation in grease pencil transform operator 2025-03-06 12:40:46 -05:00
Richard Antalik
951adb19ab Fix lite build error
Missed renaming LoadData in ifdef'd parts of code.
2025-03-06 18:38:32 +01:00
Miguel Pozo
db053ff8c5 Fix: EEVEE: Avoid double lock in ShaderModule::module_free
Use a separate lock for the module ops.

Pull Request: https://projects.blender.org/blender/blender/pulls/135587
2025-03-06 18:13:18 +01:00
Jacques Lucke
cc8979650b Screen: support garbage collection of layout panel states
Identifying layout-panels using strings and storing their open-state in their
parent panel is generally very convenient. However, right now there is no
mechanism to free the open-close state of panels that are not in use anymore.
It's generally not possible to know if a panel is not used anymore (e.g. it may
also belong to a temporarily disabled add-on). So every mechanism here will be
based on heuristics. A simple but typically very good heuristic is to just
remove the least-recently-used panel states when there are too many. So that's
what is implemented here.

This introduces a logical clock that increases whenever a panel state is used
and stores the last usage time on the panel state. This allows us to remove the
least-recently-used states later on. Specifically, that is done when the .blend
file is loaded the next time. It's not done at another time, because it quite
difficult to be sure that freeing panel states wouldn't cause dangling pointers
in such cases. I think doing it on-load should be good enough for all practical
use-cases.

Note, I don't know if the lack of such garbage collection has ever caused a
problem anywhere. However, it seems better to have some solution now than trying
to solve it after the problem has occurred and made someone's file unusable.

Pull Request: https://projects.blender.org/blender/blender/pulls/135569
2025-03-06 17:41:49 +01:00
Hans Goudey
a15005dbef Fix: Build error after recent Grease Pencil commit
Caused by e0f5ce46b7.
2025-03-06 11:00:09 -05:00
Hans Goudey
395e8796cf Fix: Missing radius change tag in curves radius transform operator 2025-03-06 10:35:36 -05:00
Falk David
5f464b2de0 Fix #135235: Grease Pencil: Crash when removing layers in python API
When iterating over the layers in a Grease Pencil object,
removing the layers can lead to crashes.

This PR is a better alternative to !135253.

Instead of checking if the layer is valid, simply fetch the latest layer
cache for each iteration and check if the index is valid.

This means that we will skip over layers if they get removed during
iteration, but we no longer can crash. If users want to remove multiple
layers at once, it's better to do this in two passes. E.g. by first
collecting the names of the layers to remove, iterating over
these names and then removing the layers by getting it by its name.

Pull Request: https://projects.blender.org/blender/blender/pulls/135574
2025-03-06 16:30:35 +01:00
Jeroen Bakker
be4f9c0ac8 Merge branch 'blender-v4.4-release' 2025-03-06 16:30:16 +01:00
YimingWu
e0f5ce46b7 Fix #134599: Grease Pencil: Connect edges when converting from mesh
The Mesh to Grease Pencil conversion would convert every edge into a stroke.
This was not the case prior to Blender 4.3. Edges with no branches would be
converted into a single stroke instead of mutliple ones.

This fix uses `geometry::mesh_to_curve_convert` from geometry nodes to
achieve more optimal result with edges connected into one stroke when
possible.

Pull Request: https://projects.blender.org/blender/blender/pulls/135557
2025-03-06 16:29:14 +01:00
Jeroen Bakker
37d781aa2a Fix #135516: Vulkan: Shader output viewport broken on RDNA2
When using the official RDNA2 driver +vulkan we see the same issue we
as #123787. Adding the same workaround to vulkan as well.

Pull Request: https://projects.blender.org/blender/blender/pulls/135565
2025-03-06 16:28:47 +01:00
Clément Foucault
f8c23fc793 Cleanup: EEVEE: Unused variables 2025-03-06 16:24:59 +01:00
Hans Goudey
466d5e2a4c Cleanup: Use StringRef for point cloud attribute names
Also these don't need to be exposed elsewhere. The same name
is used everywhere anyway. And avoid some namespace repetition
in one function.
2025-03-06 09:55:02 -05:00
Christoph Lendenfeld
ba1e51cff9 Merge branch 'blender-v4.4-release' 2025-03-06 15:54:03 +01:00
Christoph Lendenfeld
b834ca4fb1 Fix: Custom Properties named identical to existing properties fails to key
When inserting keys in the viewport by pressing `I`,
certain custom properties would not get keyed if their name
was identical to existing properties (for example `scale`).

That was because we use the name of the property to resolve
an rna path and check if the path resolved. This was of course
true in the described case and the square brackets would never be added.
The solution is to check for `RNA_property_is_runtime` which is false
for properties defined inside Blender.

Pull Request: https://projects.blender.org/blender/blender/pulls/135304
2025-03-06 15:52:29 +01:00
Clément Foucault
5a32440edf Refactor: DRW: Replace by enabled engine list by static members
Iteration is done through templates.

Removes the need for the enabled engine list/vector.

Reduces API complexity.
2025-03-06 15:20:35 +01:00
Clément Foucault
4f909ba6fd DRW: Make DRWContext thread local
The owner of the context is now always the local context.
The `DRWContext` is now a temporary object that owns
no data.

The draw debug API is being put in a non-working state by
this PR as it conflicts with the new lifetime / ownership of
the `DRWContext` class.
A new design with a global (threadsafe) debug module is needed
to add back support for these debug features. Note that these
are not user facing features.

Some parts of EEVEE are still calling the global context and that
caused crashes in the volume probe baking pipeline where
the context is not yet known. Sort circuiting these function
calls in this case fixes the issue, but a more longer term
solution would be to alway have a `DRWContext` available inside
`eevee::Instance`.

I did some testing and didn't find much of a difference in frame time.
However, we should still strive to remove all global access in the future
to avoid potential overhead of `thread_local`.

Pull Request: https://projects.blender.org/blender/blender/pulls/135521
2025-03-06 15:18:02 +01:00
Clément Foucault
e36cc4dcf7 Cleanup: Grease Pencil: Remove uneeded push-constants
All of these push-constants were either redundant or
not used anymore.

Pull Request: https://projects.blender.org/blender/blender/pulls/135561
2025-03-06 15:14:05 +01:00
Sybren A. Stüvel
15758ab854 Merge remote-tracking branch 'origin/blender-v4.4-release' 2025-03-06 14:13:03 +01:00
Sybren A. Stüvel
16d819caa9 Fix: Reorder versioning of legacy Grease Pencil and Actions
The versioning of legacy-to-modern Grease Pencil is using slotted
Actions (because that's the current animation API), and therefore
assumes that the Action & Slot assignments have been versioned as well.
The latter now actually happens before the former, so that assumption is
now actually valid.

Pull Request: https://projects.blender.org/blender/blender/pulls/135466
2025-03-06 14:12:17 +01:00
Richard Antalik
68abed543b Refactor: Remove module prefix form symbols in sequnecer namespaces
Remove
SEQ_ prefix for blender::seq namespace and
ED_sequencer for blender::ed::vse namespace

Pull Request: https://projects.blender.org/blender/blender/pulls/135560
2025-03-06 13:04:39 +01:00
Richard Antalik
21bd7ec180 Fix windows build error and warnings
Pull Request: https://projects.blender.org/blender/blender/pulls/135567
2025-03-06 11:18:28 +01:00
Clément Foucault
bb2d123fbd Cleanup: DRW: Remove ObjectInfos legacy GLSL macros
_No response_

Pull Request: https://projects.blender.org/blender/blender/pulls/135542
2025-03-06 11:06:26 +01:00
Jacques Lucke
6fc06388d4 Fix #135469: panels with same name are opened/closed together
The solution is to use a better identifier for the panel that's more unique.
2025-03-06 10:38:51 +01:00
Habib Gahbiche
02a5e6b9a0 UI: Always show cage 2D rotation handle if rotation is enabled
Followup to https://projects.blender.org/blender/blender/pulls/135065

Previously the rotation handle was drawn only when hovering over one of the corners or the rotation handle. Now it's always visible. This also restores the behavior of 2.8x.

Pull Request: https://projects.blender.org/blender/blender/pulls/135455
2025-03-06 10:32:52 +01:00
Jacques Lucke
58eaced72d Merge branch 'blender-v4.4-release' 2025-03-06 09:54:51 +01:00
Jacques Lucke
e726357962 Fix: Geometry Nodes: bad attribute propagation with multiple group outputs and warning node
The issue was that sometimes the group inputs of a node group were shuffled
around unexpectedly and thus inputs were passed to the wrong sockets.

The `or_socket_usages` function sorts the given span so that the key is more
likely to be reused, reducing the number of nodes inserted in the graph.  The
issue was that `build_warning_node` passes `group_output_used_sockets_` into the
function the order of which is important. It thus should not be reordered.

The fix is to just never reorder the span passed to `or_socket_usages` but to
make a local copy instead which can be sorted without problems. Often this copy
is done already anyway when the span is inserted into
`graph_params.socket_usages_combination_cache` as `Vector`.

This fix also makes an assumption about `Map.lookup_or_add_cb` which was not
documented before. Namely it assumes that the key is moved into the map only
after the callback has been called. This behavior is now documented and there is
a unit test for it.

Pull Request: https://projects.blender.org/blender/blender/pulls/135528
2025-03-06 09:47:44 +01:00
Omar Emara
39d0cff1dc Refactor: Compositor: Remove initial reference count
This patch removes the initial reference count mechanism from the Result
class. That's because results are no longer cached across evaluations
ever since 97ada4f307, so it is no longer useful.

Pull Request: https://projects.blender.org/blender/blender/pulls/135526
2025-03-06 08:50:22 +01:00
Campbell Barton
7d8bccbbd4 Cleanup: suppress undefined function warning
SeqRenderData declared outside the blender::seq namespace
was treated as a different type, causing the function to be treated
as undeclared.
2025-03-06 16:50:21 +11:00
Campbell Barton
50fe0f0d6b Merge branch 'blender-v4.4-release' 2025-03-06 16:37:36 +11:00
Campbell Barton
093178342d Fix crashes running Pose Slide operators without a 3D view or area
Only some of the operator logic checked for a valid area
which was assumed to be a 3D viewport which isn't necessarily the case.
2025-03-06 16:33:29 +11:00
Richard Antalik
a08246a1a2 Refactor: Move VSE code to namespaces
This PR creates 2 namespaces for VSE code:
- `blender::seq` for sequencer core code
- `blender::ed::vse` for editor code

These names are chosen to not be in conflict with each other.
No namespace was used for RNA.

Finally, file `BKE_sequencer_offscreen.h` was moved from BKE to sequencer.

Pull Request: https://projects.blender.org/blender/blender/pulls/135500
2025-03-06 06:22:14 +01:00
Campbell Barton
f2ac9c9954 Merge branch 'blender-v4.4-release' 2025-03-06 15:54:08 +11:00
Campbell Barton
fa6975b440 Fix crash calling "Set Active Modifier" without an active object 2025-03-06 15:47:16 +11:00
Hans Goudey
d88d6331fd Cleanup: Modernize mesh variable naming in some cases
Simplify naming of vertex and corner indices, and replace "loop".
2025-03-05 23:16:09 -05:00
Campbell Barton
edd041e230 Fix freed stack memory use in Visual Geometry to Objects operator
The ternary operator that selecting between `const char *` and
`std::string`, assigning to a `StringRefNull` seems to cause freed
stack memory use (reported by ASAN).

The likely cause looks to be that the `const char *` is converted to a
`std::string` then to a `StringRefNull`.
With the intermediate `std::string` going out of scope before use.

Resolve by explicitly converting both sides of the ternary operator
to a StringRefNull before assignment.
2025-03-06 15:15:26 +11:00
Campbell Barton
c3cf8600e3 Merge branch 'blender-v4.4-release' 2025-03-06 15:13:23 +11:00
Campbell Barton
64ec0b3589 Fix assert in vertex weight smooth with mirror enabled
Vertex weight smooth was running on meshes without any vertex groups
the operation to apply the weights to mirrored vertices was asserting
in this case.

Resolve by only operating on meshes with vertex groups,
also add a warning when no objects were changed.
2025-03-06 13:37:38 +11:00
Campbell Barton
9259ebbc0f Merge branch 'blender-v4.4-release' 2025-03-06 12:50:04 +11:00
Campbell Barton
f6f53551ff Fix invalid tessellation after vertex smooth with mirror enabled
Smoothing vertices with symmetry wasn't recalculating normals
before re-tessellating, meaning the faces would use an incorrect
2D projection for tessellation.

The error was exposed by an assert.
2025-03-06 12:48:39 +11:00
Harley Acheson
3e8bc9f99d Merge branch 'blender-v4.4-release' 2025-03-05 16:40:01 -08:00
Harley Acheson
8d77e842e9 Fix #135097: BLF Control Characters in When Wrapping
With 4da5377e17 control characters are shown as space characters. But
word wrapping code will use the codepoint from the glyph if available,
which means a soft wrap on space instead of a hard wrap on line feed.
Just oversight, no need to use the glyph for that. In fact we always
want to deal with the character, not the visual representation of it.

Pull Request: https://projects.blender.org/blender/blender/pulls/135541
2025-03-06 01:38:59 +01:00