Commit Graph

120055 Commits

Author SHA1 Message Date
Christoph Lendenfeld
d31ec42d24 Fix #129606: inserting keys not deselecting other keys in certain case
The issue was that when inserting a key, other keys weren't deselected
even though that feature was implemented with 6ef77a0d22
That only happened if no FCurve channel was selected in the channel list.

It turns out, that the intent of using the animfilter flags from
the editor was wrong. The animfilter code already checks the editor
flags based on the `bAnimContext` that is passed in.
In fact the drawing code itself has hardcoded flags.

So the fix is to use hardcoded flags as well.

Pull Request: https://projects.blender.org/blender/blender/pulls/129636
2024-10-31 17:39:25 +01:00
Falk David
859e4c8465 Merge branch 'blender-v4.3-release' 2024-10-31 17:11:44 +01:00
Falk David
50f01f4dce Fix #129252: GPv3: Primitive tool doesn't write to fill_opacity attribute
The primitive tool didn't write to the `fill_opacity` attribute meaning that primitives wouldn't
show up correctly when using fill materials with a strength < 1.

The fix does multiple things:
* Make sure to create and write to the `fill_opacity` attribute if necessary.
* Remove the `skipped_attribute_ids` function and build the set of attributes to skip
   where the attributes are written to. This is more flexible.

Pull Request: https://projects.blender.org/blender/blender/pulls/129644
2024-10-31 17:10:48 +01:00
Falk David
ed50dd0efe Fix #129295: GPv3: Snap Cursor to Selected includes locked layers
Snapping the 3D cursor to a grease pencil selection would include
locked layers in the computation of the centroid. This is inconsistent
with 4.2.
The fix makes sure that we skip over layers that are locked.

Pull Request: https://projects.blender.org/blender/blender/pulls/129639
2024-10-31 16:19:13 +01:00
Sergey Sharybin
981ab904ba Merge branch 'blender-v4.3-release' 2024-10-31 16:05:22 +01:00
Falk David
e6ade18707 Fix #129266: GPv3: Layer Groups hide masks by default
Previously, we initialized the layers and groups to hide masks.
For layers this makes sense, because they don't have any masks
by default, but for groups it makes more sense to show masks
by default for all the layers inside.

Pull Request: https://projects.blender.org/blender/blender/pulls/129528
2024-10-31 15:38:54 +01:00
Hans Goudey
9d7bb542a8 Merge branch 'blender-v4.3-release' 2024-10-31 15:25:58 +01:00
Clément Foucault
324517fd78 Cleanup: GPU: Fix clang tidy warnings
Removes some other things like:
- `TRUST_NO_ONE` which was the same as `#ifndef NDEBUG`.
- Replace `reinterpret_cast` by `unwrap`

Pull Request: https://projects.blender.org/blender/blender/pulls/129631
2024-10-31 15:18:29 +01:00
Hans Goudey
e65f48e8e2 Fix #128938: Crash duplicating paricle system in particle edit mode
In lieu of fixing the root cause, this commit requires the object to be
in object mode to duplicate particle systems, which works around the
issue because the problem is with particle edit data. This is a pragmatic
choice to focus development efforts on replacing the particle system.
2024-10-31 15:16:09 +01:00
Sergey Sharybin
d36c2e0fdc Merge branch 'blender-v4.3-release' 2024-10-31 14:48:40 +01:00
Hans Goudey
443cb9ff9e Fix #128945: Crash switching modes after duplicating particle system
The particle system's mirror cache wasn't cleared on the new system,
so it was freed twice when cleaning up all the particle edit mode data.
2024-10-31 14:31:24 +01:00
Clément Foucault
09fb4b498a GPU: Add more stubs for C++ shader compilation 2024-10-31 13:13:15 +01:00
Falk David
7a7c5c7306 Merge branch 'blender-v4.3-release' 2024-10-31 13:11:12 +01:00
Falk David
ab89e367da Fix #129518: GPv3: Crash entering edit mode with locked layers
Introduced with 5fff95f519.
There were several issues:
* The indices into `edit_points_vflag` are incorrect. They need to be offset
  by the start offset of the drawing.
* The code was writing to `edit_points_vflag` even if the layer is locked.
  But the size of the `edit_points_vflag` buffer is not counting locked layers.

Pull Request: https://projects.blender.org/blender/blender/pulls/129625
2024-10-31 12:56:58 +01:00
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