Commit Graph

114426 Commits

Author SHA1 Message Date
Campbell Barton
9ee0416010 Merge branch 'blender-v4.3-release' 2024-10-31 18:52:12 +11:00
Campbell Barton
83d1e6583c Merge branch 'blender-v4.3-release' 2024-10-31 18:52:10 +11:00
Campbell Barton
0ef69a0bf0 Merge branch 'blender-v4.3-release' 2024-10-31 18:52:08 +11:00
Campbell Barton
72aed90e31 Merge branch 'blender-v4.3-release' 2024-10-31 18:52:05 +11:00
Campbell Barton
44f9df305e Merge branch 'blender-v4.3-release' 2024-10-31 18:52:03 +11:00
Campbell Barton
fdec1cd94c Merge branch 'blender-v4.3-release' 2024-10-31 18:52:00 +11:00
Campbell Barton
4745a9f58e Merge branch 'blender-v4.3-release' 2024-10-31 18:51:58 +11:00
Campbell Barton
2aeba0e8f1 Fix: MEM_freeN/MEM_delete mismatch with the image save operator 2024-10-31 18:45:43 +11:00
Campbell Barton
c9d19422f0 Fix memory leak in edit-font toggle style
FONT_OT_style_toggle returned `true` instead of the canceled flag
causing it to run as a modal operator which leak memory from it's
reports when called from Python.
2024-10-31 18:45:42 +11:00
Campbell Barton
d797e9a203 Fix memory leak in "External File Operation" on non WIN32 systems 2024-10-31 18:45:41 +11:00
Campbell Barton
aeac1ab73e Fix crash calling UV picking actions without an active region 2024-10-31 18:45:40 +11:00
Campbell Barton
891db9a3ec Fix crash calling vertex slide without an active region 2024-10-31 18:45:39 +11:00
Campbell Barton
34ebdfacb0 Fix crash accessing WM capabilities in background mode 2024-10-31 18:45:39 +11:00
Campbell Barton
7a9d3e9973 Fix crash framing the camera to geometry in mesh edit-mode 2024-10-31 18:45:38 +11:00
Sean Kim
2fcc666963 Merge branch 'blender-v4.3-release' 2024-10-30 15:00:48 -07:00
Sean Kim
f52ee63114 Fix: Anchored, Line, Drag Dot stroke types do not support pen flip mode
While these modes do not use tablet pressure, they should still read
event data so that the pen status is set correctly.

Pull Request: https://projects.blender.org/blender/blender/pulls/129574
2024-10-30 22:57:42 +01:00
Sean Kim
f3ee64fe5a Fix #129553: Sculpt crash when panning immediately after saving
This commit sets the default value of the number of frustum planes
for the PBVH to zero to prevent accessing invalid memory in cases where
the data may otherwise be uninitialized.

Pull Request: https://projects.blender.org/blender/blender/pulls/129600
2024-10-30 22:56:35 +01:00
Bastien Montagne
29c66dab88 Restore 'writable' handling in bpy_class_call.
Refactor 1dbe94c8ac restored the 'old' proper way to directly call the
python type (i.e. use the python's implementation to create objects),
instead of using the 'specialized' type creation code.

However, the handling of the ugly `rna_disallow_writes` global was only
added later to the 'workaround' part of the code, but not to the original
'canonical' one.

This commit copies the handling of `rna_disallow_writes` back into the
now active part of the code.

This solves the `is_readonly_init` unused variable build warning.

NOTE: At some point the BPY code needs a good cleanup pass, there are
way to many pieces of codes #ifdef'ed there.
2024-10-30 19:21:10 +01:00
Jesse Yurkovich
391612c725 USD: Add support for animated volumes
The existing Volume export, which already supports VDB file sequences
and static volumes created inside Blender, is now extended to handle
dynamically created and modified volumes. This allows scenarios where a
Volume Displace modifier is placed over-top an existing VDB sequence or
when Geometry Nodes is used to create animated volumes procedurally.

Detection of what counts as animation is simplistic and mimics what has
been used for Meshes. Essentially if there are any modifiers on the
volume we assume that the volume is "varying" in some way. This can lead
to situations where new volume files are written unnecessarily.

Volume import was also adjusted to correctly set the sequence "offset"
value. This is required to properly handle the case when a VDB sequence
begins animating at a different frame than what's implied by the file
name. For example, a VDB file sequence with file names containing 14-19
but the user wants to animate on frames 8-13 instead.

Tests are added which cover:
- Animated VDB file sequences
- Animated Mesh To Volume where the mesh has been animated
- Animated Volume Displacement where displacement settings are animated
- Animated Volumes created with a Geometry Nodes simulation

----
New test data has been checked in: `tests/data/usd/usd_volumes.blend` and files inside `tests/data/usd/volume-data/`

Pull Request: https://projects.blender.org/blender/blender/pulls/128907
2024-10-30 18:29:35 +01:00
Hans Goudey
08a9c8b786 Merge branch 'blender-v4.3-release' 2024-10-30 17:41:08 +01:00
Hans Goudey
a48f7f67f7 Fix #129550: Node group default width not working for link-drag-search
When this feature was added we missed accounting for it in
all places where node groups were added.
2024-10-30 17:40:39 +01:00
Bastien Montagne
1dbe94c8ac RNA: Make the PointerRNA struct non-trivial.
For now, PointerRNA is made non-trivial by giving explicit default
values to its members.

Besides of BPY python binding code, the change is relatively trivial.
The main change (besides the creation/deletion part) is the replacement
of `memset` by zero-initialized assignment (using `{}`).

makesrna required changes are quite small too.

The big piece of this PR is the refactor of the BPY RNA code.

It essentially brings back allocation and deletion of the BPy_StructRNA,
BPy_Pointer etc. python objects into 'cannonical process', using `__new__`,
and `__init__` callbacks (and there matching CAPI functions).

Existing code was doing very low-level manipulations to create these
data, which is not really easy to understand, and AFAICT incompatible
with handling C++ data that needs to be constructed and destructed.

Unfortunately, similar change in destruction code (using `__del__` and
matching `tp_finalize` CAPI callback) is not possible, because of technical
low-level implementation details in CPython (see [1] for details).

`std::optional` pointer management is used to encapsulate PointerRNA
data. This allows to keep control on _when_ actual RNA creation is done,
and to have a safe destruction in `tp_dealloc` callbacks.

Note that a critical change in Blender's Python API will be that classes
inherinting from `bpy_struct` etc. will now have to properly call the
base class `__new__` and/or `__init__`if they define them.

Implements #122431.

[1] https://discuss.python.org/t/cpython-usage-of-tp-finalize-in-c-defined-static-types-with-no-custom-tp-dealloc/64100
2024-10-30 15:08:37 +01:00
Clément Foucault
1b130f651a Fix: Metal: Remove some more warning & errors
Fix by either changing the user level code,
or by removing the warnings that are not helpful.
2024-10-30 14:58:26 +01:00
Aras Pranckevicius
44ec81695c Fix #129325: VSE blur effect is biased for byte images
Lack of rounding in non-float images was leading to e.g. pure white
becoming just a tiny bit darker than pure white at some blur sizes.
2024-10-30 14:41:54 +02:00
Rob-Blair
dd334faa58 Fix #125024: Bevel offset - eliminate divide by 0.
From Rob Blair's PR https://projects.blender.org/blender/blender/pulls/126309 .
In the code that clamps the bevel amount, the existing code could get
a denominator of 0 (from a tangent of a certain angle).
This code uses a different calculation (diagram in the PR) that clamps
when the projections of four specific edges onto another edge consumes
the whole length of that edge.
2024-10-30 08:21:51 -04:00
Aras Pranckevicius
30d606ea86 Cleanup: cleaner initialization of VSE effects
This is not C anymore, no need to declare variables at start of function
2024-10-30 13:41:38 +02:00
Aras Pranckevicius
66889e4a41 Fix: VSE GaussianBlur effect using wrong allocation size
init_gaussian_blur_effect was allocating memory for sizeof(WipeVars)
instead of sizeof(GaussianBlurVars). Not a problem today since WipeVars
is slightly larger, but this is an accident waiting to happen.
2024-10-30 13:41:38 +02:00
Omar Emara
81cb127612 Compositor: Implement Mix RGB node for new CPU compositor
Reference #125968.
2024-10-30 14:32:10 +03:00
Omar Emara
4359a308dd Compositor: Implement Alpha Over for new CPU compositor
Reference #125968.
2024-10-30 14:31:26 +03:00
Omar Emara
03ec5b6cfb Compositor: Implement Combine Color for new CPU compositor
Reference #125968.
2024-10-30 14:30:46 +03:00
Omar Emara
51a6eb35c0 Compositor: Implement Separate Color for new CPU compositor
Reference #125968.
2024-10-30 14:29:49 +03:00
Campbell Barton
160e76cd9d Cleanup: remove unused function BM_mesh_active_elem_index_get
Getting the active index without knowing the element type
doesn't seem to have any practical use.
2024-10-30 15:47:43 +11:00
Campbell Barton
47926da31d Merge branch 'blender-v4.3-release' 2024-10-30 13:09:22 +11:00
James Fulop
42657cd1b6 Tests: add BLI_path_slash_* tests
Ref !127304
2024-10-30 13:07:33 +11:00
Hans Goudey
4b842b8330 Merge branch 'blender-v4.3-release' 2024-10-29 23:58:55 +01:00
Clément Foucault
7c979d6d40 Fix: Metal: Error caused by missing const_cast
Error introduced by 7dc43b7dd2
2024-10-29 23:55:24 +01:00
Hans Goudey
c4d22839b4 Cleanup: Typo in variable name, consistent naming 2024-10-29 23:48:22 +01:00
Hans Goudey
eaafe7218e Fix: Wrong change in refactor of paint smear brush
Mistake in 437cb33a73.
Found while investigating #129504. Personally I don't notice
a change in behavior, but the original code, as convoluted as it
was/is, clearly tried to iterate over neighbors of neighbors rather
than iterating over neighbors twice.

Pull Request: https://projects.blender.org/blender/blender/pulls/129557
2024-10-29 23:45:58 +01:00
Hans Goudey
9a0d4dbd04 Fix #129504: Color smear brush performance regression
For cases where a small fraction of a PBVH node is processed,
missing skipping of vertices outside of the brush radius causes
a noticeable regression. Typically we tried to avoid this sort of
filtering because it should be redundant with lowering the BVH
node size and it interferes with some other code simplicity goals.
But adding factor filtering back is a very small change.
2024-10-29 23:45:38 +01:00
Hans Goudey
e247c358db Fix: Wrong change in refactor of paint smear brush
Mistake in 437cb33a73.
Found while investigating #129504. Personally I don't notice
a change in behavior, but the original code, as convoluted as it
was/is, clearly tried to iterate over neighbors of neighbors rather
than iterating over neighbors twice.

Pull Request: https://projects.blender.org/blender/blender/pulls/129557
2024-10-29 23:18:19 +01:00
Sean Kim
9a0b1f048f Merge branch 'blender-v4.3-release' 2024-10-29 14:55:42 -07:00
Sean Kim
aa937b1cab Fix #128859: Undoing sculpt with deform modifier active doesn't work
Prior to this commit, there was an attempt to remove extra data stored
at the Sculpt Undo `Node` level, specifically an extra position array
used when a deform modifier was in the stack.

The prior commit attempted to perform the undo step by calculating a
translation between the current positions and the previous unode
position and using that as the input to the deformation process.
However, this resulted in the undo not being completely applied to the
mesh and the data remaining in a weird state.

To fix this, this commit reintroduces some previously removed functions
and constructs to perform this restore step by swapping data if
necessary. We choose to not simply revert the change that applied this
as we want to eventually reinvestigate this path, but for the imminent
4.3 release, it makes more sense to restore previous behavior.

Pull Request: https://projects.blender.org/blender/blender/pulls/129496
2024-10-29 22:43:11 +01:00
Sean Kim
80f4b4806a Merge branch 'blender-v4.3-release' 2024-10-29 14:36:28 -07:00
Sean Kim
d1e78481e2 Fix #129519: Topology automasking stops working on multires level switch
The topology island cache needs to be freed when changing multires
levels so that it can be recalculated and be valid for a given level. To
fix this, this commit adds the `invalidate` call to the
`BKE_sculptsession_free_pbvh` method, which consolidates similar
lifecycle behavior.

Pull Request: https://projects.blender.org/blender/blender/pulls/129549
2024-10-29 22:32:53 +01:00
Sean Kim
0ca50a4372 Merge branch 'blender-v4.3-release' 2024-10-29 14:06:25 -07:00
Sean Kim
e48657eb8a Revert "Fix #126939: Smooth / Enhance Details brush crash when using tablet"
This reverts commit 304800db73.
2024-10-29 14:04:34 -07:00
Richard Antalik
04509992c5 Merge branch 'blender-v4.3-release' 2024-10-29 21:52:44 +01:00
Clément Foucault
7dc43b7dd2 Fix: Metal: Remove some more shader compilation warnings 2024-10-29 21:45:03 +01:00
Richard Antalik
1fadc4b5e3 Fix: VSE: Handle tweaking does not work when retiming key is selected
`select_handle` operator did return passthrough when retiming key was
selected. This was incorrect behavior. To prevent translating retiming
keys, retiming selection must be cleared as well.

Reported in #126273

Pull Request: https://projects.blender.org/blender/blender/pulls/129289
2024-10-29 21:20:21 +01:00
Sean Kim
26a741f7a3 Merge branch 'blender-v4.3-release' 2024-10-29 13:11:21 -07:00