Commit Graph

121566 Commits

Author SHA1 Message Date
Sean Kim
a138106fac Cleanup: Remove unnecessary const and enum prefixes
Pull Request: https://projects.blender.org/blender/blender/pulls/141691
2025-07-14 23:58:26 +02:00
Jesse Yurkovich
cbb6cdf8d7 Fix #141633: Various subdivision problems during Alembic import
This fixes 4 bugs all conspiring to make the referenced SubD scenario
quite broken:

- When manually creating a MeshSequenceCache, the reading of edge and
  vertex crease data was skipped. Fixed by reading crease data inside
  the common `read_mesh` method.
- When importing an Alembic with animated edge or vertex crease data, a
  MeshSequenceCache modifier was not being added to the object. This was
  due to not checking the relevant crease properties and required adding
  a specialized `has_animations` function.
- When importing animated vertex crease data, a duplicate `vertex_crease`
  attribute would be created, breaking the animation. Fixed by using the
  attribute API rather than custom data.
- The MeshSequenceCache scenario would call into the Alembic Mesh reader
  which ended up referencing deallocated stack memory for the
  ImportSettings. In release builds this would cause sporadic failures
  because the value of `blender_archive_version_prior_44` would be
  random. There was already a very old TODO for this and we finally
  really needed to address it.

A new test was added which exports animated creases on two meshes and
re-imports them back in. It verifies that each mesh gets a
MeshSequenceCache modifier added and also ensures the values of the
creases are correct for all frames.

Pull Request: https://projects.blender.org/blender/blender/pulls/141646
2025-07-14 21:49:23 +02:00
Miguel Pozo
05dcc0377b Fix: GPU: Missing error logs
Regression from d5f84d0016.
2025-07-14 18:53:35 +02:00
Jacques Lucke
00c81f5113 Merge branch 'blender-v4.5-release' 2025-07-14 16:30:38 +02:00
Jacques Lucke
7f07124d30 Fix #141847: Input node properties missing in sidebar
This was caused by 87c011f8bb. The drawing code for the input nodes was moved
into a new `custom_draw_fn` callback on the socket declaration. This was not
taken into account when drawing the sidebar yet, which is an oversight and was
not an intentional change.

This fix applies to all the nodes that use the new custom draw function.

Pull Request: https://projects.blender.org/blender/blender/pulls/141872
2025-07-14 16:29:19 +02:00
Jacques Lucke
1f2f9aef51 Fix #141800: crash when showing node warnings during playback
The node warnings were only referenced by the tooltip function. Since they are
recreated on every evaluation, this resulted in a use-after-free. The fix is to
just copy the node warnings into the callback.

Of course this extra copy does have some performance implications, but I don't
think those are significant currently.

Pull Request: https://projects.blender.org/blender/blender/pulls/141875
2025-07-14 16:28:39 +02:00
YimingWu
4096309753 Fix #141819: Interface Use a flag for WM_set_locked_interface
Different operations may need to lock different part of the interface,
e.g. for rendering, the image editor may still need refreshing while the
interface is locked, but when baking data into a scene, the image editor
needs to be locked because it is not thread safe to get data from a
partially evaluated depsgraph.

This is a better fix on top of 7c8b8b2457
that addresses the root cause with more flexibility for future
operations that requires different interface locking strategy as
well.

Pull Request: https://projects.blender.org/blender/blender/pulls/141866
2025-07-14 16:17:46 +02:00
Sebastian Parborg
ad2e7434c8 Fix: Local method in versioning_500 was not static 2025-07-14 15:50:03 +02:00
Sybren A. Stüvel
cda4e0cfe6 Fix #141890: Join as Shapes should rebuild depsgraph relations
When the Join as Shapes operator created new shape keys, trigger a rebuild
of depsgraph relations. Otherwise mesh evaluation may see original keys
instead of evaluated ones.

Pull Request: https://projects.blender.org/blender/blender/pulls/141892
2025-07-14 15:09:30 +02:00
Bastien Montagne
159ea313f3 BPY: Add basic blendfile version info in data returned by bpy.data.libraries.load()
Only major and minor versions are available at that point, not the
blendfile subversion.

Version info is available in both `bpy_library` items returned by the
context handler, as a `version` property that is a tuple of two numbers.

Co-authored-by: Campbell Barton <campbell@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/141462
2025-07-14 14:43:08 +02:00
Hans Goudey
81cf923fe3 Fix #141735: "Join as Shapes" operator too restrictive
Caused by 3d6ea7c075
Before that commit, it was possible to retrieve shape key data from
other objects with a different number of edges or faces. One crucial
case where that is important is when the other mesh is a triangulated
with otherwise the same vertex count.

In general it's better to be flexible and allow other changes besides
the vertex count, especially since that's such a simple check that users
can easily understand.

Pull Request: https://projects.blender.org/blender/blender/pulls/141794
2025-07-14 14:28:22 +02:00
Bastien Montagne
33973970a5 Fix #139527: LibraryOverride bug because of Hair Curves.
The 'surface' Object pointer of the new curves ID was not defined as
overridable, which would break liboverride hierarchies, which would then
be re-generated everytime on blendfile opening.
2025-07-14 12:51:26 +02:00
Sebastian Parborg
a172b40d56 PointCache: Remove support for LZO and LZMA compression, use ZSTD
LZO and LZMA is only used for compressing point caches inside of
Blender. As we already use ZSTD for compressing other data in Blender it
makes sense to remove LZO and LZMA to simplify our library requirements
(and lessen our library maintenance burden).

I've talked to Sergey about this and he suggested that I leave the LZO/LZMA
libraries and code around but effectively disabled until beta, so if there is a
huge uproar, we can easily reinstate the support.

Pull Request: https://projects.blender.org/blender/blender/pulls/141461
2025-07-14 12:51:04 +02:00
Sybren A. Stüvel
dbffebda30 Merge remote-tracking branch 'origin/blender-v4.5-release' 2025-07-14 11:45:56 +02:00
Falk David
45ab790e80 Grease Pencil: Initialize runtime drawing user counts on read
This adds a function `GreasePencil::count_frame_users_for_drawings()`
that computes the drawing user counts from the layer frames. This is used
to correctly initialize the runtime drawing user counts when reading the ID.

Note that we don't expose any functionality to instance drawings currently.
This change is also in preparation for when this will be possible.

Also adds a function `GreasePencil::validate_drawing_user_counts()` that
compares the actual user counts with the runtime user counts that are
stored. Only runs these checks in debug builds.

Pull Request: https://projects.blender.org/blender/blender/pulls/141458
2025-07-14 11:44:57 +02:00
Sybren A. Stüvel
c64e13ecae Fix #141882: Undo with local asset in asset shelf crashes Blender (ASAN)
Replace a `StringRef` with `std::string`, so that a copy is made of the
grid item identifier.

This identifier is used on redraw, to correlate the newly-drawn items
with items from the previous redraw. Using a `StringRef` here was
problematic when there's local assets, as those can be freed & re-built
(which in the case of the report happens on save/undo). Because of this,
the reference got corrupted, and the map lookup would fail. The "old
items" map now has a copy of the identifier, ensuring it is independent
of the data it represents.

Co-authored by Julian Eisel.

Pull Request: https://projects.blender.org/blender/blender/pulls/141888
2025-07-14 11:43:52 +02:00
Sybren A. Stüvel
13f0d6a859 Merge remote-tracking branch 'origin/blender-v4.5-release' 2025-07-14 11:25:48 +02:00
Sybren A. Stüvel
70ed5aca89 Fix #141828: Applying outdated PoseAssets crashes Blender
Gracefully handle the situation where an F-Curve in the pose asset targets
a bone that no longer exists.

Pull Request: https://projects.blender.org/blender/blender/pulls/141880
2025-07-14 11:20:13 +02:00
Sergey Sharybin
d156a047fd Merge branch 'blender-v4.5-release' 2025-07-14 11:09:04 +02:00
Sergey Sharybin
08ec4602a2 Fix #141768: VSE: Tabbing in/out of metastrips does not update strip cache
Regression caused by 9e4c26574a.

Add strip stack as a key to the final cache.

Use the pointer to the list of sequences, as it is the easiest one to
obtain in all places where it is needed. This is slightly different
from the code prior to the 9e4c26574a where strips.last() was used,
but it allows to use the same logic in the prefetch job.

Pull Request: https://projects.blender.org/blender/blender/pulls/141778
2025-07-14 11:08:39 +02:00
Omar Emara
62e0a9105a Fix #141864: Crash opening files with Alpha Over node
Blender will crash if a file with an Alpha Over node was saved in 4.4,
then in 4.5 alpha, then back to 4.4. This is because the node was
missing forward compatibility code that allocates storage that was
necessary for the file to load correctly on older versions.

This was essentially missed in b62ef2cdd6 and 976efdcac9.

Pull Request: https://projects.blender.org/blender/blender/pulls/141873
2025-07-14 09:31:41 +02:00
Pratik Borhade
07b070404a Fix: Grease Pencil: Problem removing last layer with attributes
Caused by 68759af516
Deleting first layer (i.e. last in the tree view), layer attribute values
of previous layers gets messed up due to wrong offset value when
copying attribute data

Pull Request: https://projects.blender.org/blender/blender/pulls/141772
2025-07-14 08:49:51 +02:00
Hans Goudey
14e2876b73 Core: Replace BLI_buffer.hh with blender::Vector
The C++ Vector container has the benefits of the older C type,
along with improved performance, better type and memory safety,
and significantly improved ergonomics.

Pull Request: https://projects.blender.org/blender/blender/pulls/141759
2025-07-13 17:13:59 +02:00
Campbell Barton
ec8751f826 Cleanup: white-space around C-style comment blocks
Also use C++ style comments for disabling code.
2025-07-13 21:58:53 +10:00
Campbell Barton
a34c943e37 WM: correct own regression in recent cursor size clamping
When calculating the font size clamp by the requested cursor size
instead of 256.

This will often make the cursor smaller since allowing 256px wide
cursors is quite large.

Also de-duplicate size checks & round the text size to an integer to
avoid fractional scaling from subtle changes to the text.
2025-07-13 13:44:10 +10:00
Campbell Barton
4820bcc7cc Cleanup: doc-strings for currsor rasterization
Also add a safeguard to ensure the resulting cursor
never exceeds the requested size.
2025-07-13 12:28:32 +10:00
Campbell Barton
566afb8201 WM: access the windows DPI directly to calculate the mouse-cursor scaling
Instead of relying on the the `U.ui_scale` being set when activating
the window, calculate the cursor size from the windows DPI.

This also de-duplicates cursor scale calculation.
2025-07-13 11:57:29 +10:00
Campbell Barton
41fc42697c Cleanup: rename WM_window_{set_dpi => dpi_set_userdef}
The name read as if it was setting the DPI however the window DPI
was being calculated and written into the #UserDef (U).
2025-07-13 11:31:41 +10:00
Campbell Barton
a3d30afca1 Cleanup: move cursor details into struct doc-strings 2025-07-13 11:25:09 +10:00
Campbell Barton
10fab706f5 Cleanup: pass the cursor size to cursor_bitmap_from_text
Rename cursor_size() to wm_cursor_size() to allow this to be used
as an argument name without shadowing.
2025-07-12 20:54:27 +10:00
Campbell Barton
31ac70e6c2 Refactor: extract cursor rasterization into separate function calls
Prepare for dynamic cursor generation from !141597.
2025-07-12 20:36:01 +10:00
Campbell Barton
deda15f386 Cleanup: minor changes to wm_cursors.cc
- Use "g_" prefix for cursors to signify that it's global but local to
  the file.
- Use `const` cast passing pixel data to GHOST_SetCustomCursorShape.
- Remove redundant cast.
2025-07-12 19:24:14 +10:00
Campbell Barton
420a6a5bb6 WM: restore test code from previous commit
Restore UI_SCALE_FAC use for disabled testing logic.
2025-07-12 19:10:35 +10:00
Campbell Barton
eb836d8ae1 WM: use the systems DPI for cursor scale instead of the UI scale
Cursor size calculation now uses the GHOST DPI without the UI scale
since the UI scale doesn't impact system cursors.
2025-07-12 19:01:32 +10:00
Harley Acheson
bea1dbfab0 UI: Cursor Time for RGBA Platforms
The Windows and Wayland platforms can both create antialiased mouse
cursors from SVG sources. Platforms with WM_CAPABILITY_CURSOR_RGBA
can therefore show a better version of "WM_cursor_time". Instead of
four blocky digits in two rows this displays beautiful digits in a
single row.

Pull Request: https://projects.blender.org/blender/blender/pulls/141367
2025-07-12 05:22:41 +02:00
Jesse Yurkovich
deb86f3840 Cleanup: USD: Assign op properties directly to the import/export options
Assign the incoming operator properties directly to their corresponding
import/export options. This removes over 100 lines of unnecessary
ceremony assigning to local variables first.

Pull Request: https://projects.blender.org/blender/blender/pulls/141803
2025-07-12 00:10:31 +02:00
Jesse Yurkovich
c8052bd0dc Cleanup: USD: Use string instead of char array for prim_path options
Use `std::string` rather than raw char arrays for `root_prim_path` and
`prim_path_mask`. This is a more natural fit for these arbitrary length
strings and it simplifies downstream consumers of the values.

Pull Request: https://projects.blender.org/blender/blender/pulls/141801
2025-07-11 22:59:35 +02:00
Guillermo Venegas
c97195cd63 Refactor: UI: Replace uiItemMenuEnumFullO* with class methods
This converts the public uiItemMenuEnumFullO* functions to an
object-oriented API (as uiLayout::op_menu_enum overloads),
matching recent changes in the API.

Part of: #117604

Pull Request: https://projects.blender.org/blender/blender/pulls/141797
2025-07-11 19:52:58 +02:00
Hans Goudey
8f198a85b4 Refactor: Add RNA_string_get function returning a string
This can replace most uses `RNA_string_get_alloc` and give us
better type safety and generally simpler code.

Internally, this uses the function added in 50076993f3.

Pull Request: https://projects.blender.org/blender/blender/pulls/141358
2025-07-11 16:24:13 +02:00
Sybren A. Stüvel
7e3c5d021b Cleanup: document the PROP_ID_REFCOUNT RNA property flag
Document what the flag does, and explain that it effectively gets nullified
when there is a custom setter function.

No functional changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/141739
2025-07-11 16:19:14 +02:00
Hans Goudey
d677a0636e Fix: Incorrect selection check in vertex group smooth after cleanup
Mistake in 546d3495a8.
Thanks to Campbell for spotting this.
2025-07-11 09:29:45 -04:00
Guillermo Venegas
1f34dc9155 Refactor: UI: Replace uiItemsEnumO with class method uiLayout::op_enum
This converts the public uiItemsEnumO and uiItemsFullEnumO functions
to an object-oriented API (as uiLayout::op_enum overloads), matching
recent changes in the API.

Part of: #117604

Pull Request: https://projects.blender.org/blender/blender/pulls/141748
2025-07-11 15:25:30 +02:00
Philipp Oeser
8840aa8718 Merge branch 'blender-v4.5-release' 2025-07-11 13:19:36 +02:00
Philipp Oeser
481776a105 Fix #141727: Toggling overlays with enabled Retopology missing update
Meshes could still be present or missing when toggling overlays.

Toggling overlays alone does not trigger object syncing (which is needed
here since the visibility of active object might change).

So to resolve, trigger `rna_SpaceView3D_retopology_update` when toggling
overlays with enabled Retopology

Ref. 6fee44760a

Pull Request: https://projects.blender.org/blender/blender/pulls/141731
2025-07-11 13:19:18 +02:00
Habib Gahbiche
9a33108afc Compositor: Support rotation for Split Node Gizmo
The split gizmo now supports rotation. It uses the same rotation
handle for `cage2d` gizmos

Pull Request: https://projects.blender.org/blender/blender/pulls/140356
2025-07-11 11:59:46 +02:00
Habib Gahbiche
b35971ad08 Compositor: Rename "Z" to "Depth" in Z Combine Node
Node:
- Rename "Z Combine" node to "Depth Combine"

Sockets:
- First input "Image" -> "A"
- Second input "Image" -> "B"
- First Z -> "Depth A"
- Second Z -> "Depth B"
- Output Image -> "Result"
- Output Z -> "Depth"

This is a breaking change for the Python API

Pull Request: https://projects.blender.org/blender/blender/pulls/141676
2025-07-11 11:58:29 +02:00
Julian Eisel
dd81681583 Refactor: Start splitting filelist.cc
This file is rather big. I'm working in it quite a lot, and find it very
hard to navigate in. I constantly get lost or spend time manually
looking for things.

Move the file to a directory, add an internal header, and split out
filtering and sorting code into own files. I'm sticking with these for
now to not cause too many conflicts with blender/blender!130543, which
does a lot of changes/additions to filelist.cc.

Pull Request: https://projects.blender.org/blender/blender/pulls/141744
2025-07-11 11:30:04 +02:00
Nathan Vegdahl
03332c514d Cleanup: Use prescribed symbol syntax in Path Template code comments
Specifically, #Symbol rather than `Symbol`, as documented in
https://developer.blender.org/docs/handbook/guidelines/c_cpp/#comments

This is a follow up to #139438

Pull Request: https://projects.blender.org/blender/blender/pulls/141775
2025-07-11 11:00:52 +02:00
Lukas Tönne
efeb11b9c5 Fix #141012: Curve template allows zooming out beyond clip range
The clipping flag of curve templates is applied only to point positions,
but allows zooming beyond the clip range due to numerial error.

If clipping is disabled the curve view rect is still restricted to
clip ranges (this could be considered a bug). However, zooming in and
back out leaves a tiny offset to the clip rect that allows one more
zoom-out step.

This patch ensures the curve rect is always within the clip rect.
When the difference is very small the view rect is snapped to the clip
rect.

Pull Request: https://projects.blender.org/blender/blender/pulls/141275
2025-07-11 10:15:19 +02:00
Omar Emara
c53a839631 Compositor: Support host allocation for GPU compositing
This patch allows allocating results on the host even if the context
uses GPU. It also adds support for uploading the host result into a GPU
allocated result. This is done to allow using results for storing data
that gets computed on the CPU be end up on the GPU, like some of the
cached resources used by the compositor. Those resources are refactored
accordingly in this patch as well.

Pull Request: https://projects.blender.org/blender/blender/pulls/141745
2025-07-11 07:55:11 +02:00