Commit Graph

114440 Commits

Author SHA1 Message Date
Campbell Barton
38a2bb48fb Merge branch 'blender-v4.3-release' 2024-10-31 21:56:52 +11:00
Campbell Barton
1591f557a0 Merge branch 'blender-v4.3-release' 2024-10-31 21:56:50 +11:00
Omar Emara
98722773da 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-10-31 13:53:26 +03:00
Campbell Barton
2a2ad0c662 Fix error in recent fix for Rotate Edges
k
Commit [0] accidentally removed a check for edges not to rotate.

[0]: a0491899f0
2024-10-31 21:53:18 +11:00
Falk David
dc80fe879b Fix #129333: GPv3: Crash when selecting bezier curves
Introduced by 74129b648b.
The issue was that the code didn't check if the selection attribute
exists which it might not.

Pull Request: https://projects.blender.org/blender/blender/pulls/129623
2024-10-31 11:48:08 +01:00
Laurynas Duburas
c806f885d4 Curves: Align handles in transform operator
Aligns Bezier handles when both handles are of the`BEZIER_HANDLE_ALIGN`
type. If the left handle is selected, then the right one is aligned
with it. The left handle is aligned with the right handle only if the
left handle is not selected.

Rel #105038

Pull Request: https://projects.blender.org/blender/blender/pulls/128726
2024-10-31 11:25:41 +01:00
Laurynas Duburas
229e0a8cae Curves: Convert handle types when transforming
Converts Bezier handle types when transforming starts.
If single BEZIER_HANDLE_AUTO handle is transformed it becomes
BEZIER_HANDLE_ALIGN. If single BEZIER_HANDLE_VECTOR handle is
transformed it becomes BEZIER_HANDLE_FREE.

https://docs.blender.org/manual/en/latest/modeling/curves/structure.html

Rel #105038

Pull Request: https://projects.blender.org/blender/blender/pulls/128638
2024-10-31 10:42:24 +01:00
Clément Foucault
0deec1005c GPU: Remove some warnings and errors in GLSL C++ Stubs 2024-10-31 10:18:32 +01:00
Campbell Barton
77a4954b68 Merge branch 'blender-v4.3-release' 2024-10-31 18:52:19 +11:00
Campbell Barton
fce0e43140 Merge branch 'blender-v4.3-release' 2024-10-31 18:52:17 +11:00
Campbell Barton
965b9660e9 Merge branch 'blender-v4.3-release' 2024-10-31 18:52:14 +11:00
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
5b53ff078d Fix "Apply Modifier as Shape" ignoring Alt to apply to selected
The property was set & checked but the operator didn't define it.
2024-10-31 18:45:46 +11:00
Campbell Barton
a0491899f0 Fix "Rotate Edges" iterating over freed edges
Rotating an edge deletes the edge and creates a new edge
however these edges were being iterated over and had their indices
checked.

In practice this wasn't causing use-after-free errors because the
edges are part of a BLI_mempool, nevertheless using freed elements of a
memory-pool should be avoided.
2024-10-31 18:45:45 +11:00
Campbell Barton
29e184596e Fix error accessing invalid stack memory joining areas from a shortcut
Avoid relying on an area lookup with off-screen coordinates,
check if the properties were set instead.
2024-10-31 18:45:44 +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