Commit Graph

114469 Commits

Author SHA1 Message Date
Hans Goudey
45f28ab599 Cleanup: Sculpt: Simplify arguments to node debug drawing
These are either always a certain value or retrievable from the node.
2024-11-01 15:01:15 +01:00
Hans Goudey
7853f07ca3 Cleanup: Sculpt: Remove redundant PBVH header
There is no need to have both `BKE_pbvh_api.hh` and `BKE_pbvh.hh`.
This commit removes the latter, moving the few remaining items to
the former, which will be renamed later.
2024-11-01 14:31:45 +01:00
Hans Goudey
0a05debe49 Cleanup: Sculpt: Improve some PBVH comments 2024-11-01 13:56:02 +01:00
Clément Foucault
47f7aaa2cc Merge branch 'blender-v4.3-release' 2024-11-01 12:16:38 +01:00
Hans Goudey
37e35147d8 Fix: PanelType unregister potential use-after-free
There are two issues here. First, the instanced panel freeing uses
the panel type after it's been freed a few lines up in this function.
Second, while panel types are registered for a single space type,
there are cases where they're used in multiple space/region types
anyway. Because of that, removing the dangling pointer of the freed
type from just the registered region & space type combination isn't
enough, we need to process all regions.

Pull Request: https://projects.blender.org/blender/blender/pulls/129676
2024-11-01 12:14:44 +01:00
Jason Fielder
7fbc9e9428 Fix: Metal: Memory leaks identified by Instruments and Xcode memory graph.
Running Xcode memory graphs and the Instruments tools revealed
memory leaks caused, in the main, by over-retained objects.
This removes the unnecessary 'retains' and adds some asserts
to guard against over-retaining in the future.

There are a few memory leaks remaining involving PyUnicode_DecodeUTF8
but I am unable to identify the cause of these at this time.

Authored by Apple: James McCarthy

Pull Request: https://projects.blender.org/blender/blender/pulls/129117
2024-11-01 11:56:51 +01:00
Hans Goudey
509090e7c3 Subdiv: Remove evaluator C-API wrapper
Similar to 5e46e3d28a.

This commit replaces the C-API version of `OpenSubdiv_Evaluator`
with direct calls to `EvalOutputAPI`. This removes a level of indirection,
theoretically reducing function call overhead, but also making the whole
system easier to understand and easier to modify. The downside is
further spread of `WITH_OPENSUBDIV` into the code, but I think that
can be improved in the future relatively easily once more of this sort
of change is finished.

Pull Request: https://projects.blender.org/blender/blender/pulls/128278
2024-11-01 09:42:33 +01:00
Richard Antalik
63dabd3e37 Merge branch 'blender-v4.3-release' 2024-11-01 02:08:55 +01:00
Richard Antalik
9ef6136865 Fix #126273: Retiming movies with mismatched FPS is broken
There were lot of places, where timeline frame was incorrectly
mapped to frame index.

For deleting transitions, internal  function `seq_retiming_add_key`
was added. It can work in frame index domain directly. This is to avoid
adding more complexity, since key positions are stored and re-created
later. Going  through index to frame and back to index would introduce
float precision errors.

Pull Request: https://projects.blender.org/blender/blender/pulls/129305
2024-11-01 02:07:53 +01:00
Richard Antalik
ba59908dc8 Fix #129226: Retiming transition to faster speed does not work
Caused by comparing speed of segment before transition and transition
itself. It should compare speed of segment after transition instead.

Pull Request: https://projects.blender.org/blender/blender/pulls/129610
2024-11-01 02:06:44 +01:00
Richard Antalik
d50d1e757b Fix #129583: Retiming controls are drawn even if strip is too small
Hide retiming controls if strip height or width is smaller than
threshold.

Pull Request: https://projects.blender.org/blender/blender/pulls/129612
2024-11-01 02:04:59 +01:00
Sean Kim
dd7064b2e1 Cleanup: Various non-functional changes for paint_stroke.cc
This commit applies the following changes:
* Use c++ math types instead of float / int arrays where possible
* Use c++ math library where c++ math types are used
* Use const where possible
* Reduces scope of variables where possible
* Clarifies some variable naming (e.g. d prefix to _delta suffix)

The main areas left untouched are anything that is part of a public
function signature to avoid making changes in many different files at
once.

Pull Request: https://projects.blender.org/blender/blender/pulls/129576
2024-10-31 21:11:59 +01:00
Sean Kim
3ff2733279 Cleanup: Sculpt: Remove PBVH frustum plane and related calculation
The recent refactor of sculpt mode drawing (d601bf7e) removed usage of
the update frustum planes. This makes storage of this data inside the
PBVH also unnecessary. If this feature needs to be reimplemented in the
future, the storage of the planes should be outside of the PBVH `struct`

Pull Request: https://projects.blender.org/blender/blender/pulls/129649
2024-10-31 21:10:31 +01:00
Hans Goudey
77a7671f54 Cleanup: Avoid writing sculpt session runtime pointer to files
`SculptSession` is a runtime struct that should really be stored in
`ObjectRuntime` instead of `Object`. Writing pointers to it in files
is misleading because the struct itself isn't serialized.

Pull Request: https://projects.blender.org/blender/blender/pulls/129233
2024-10-31 17:48:57 +01:00
Christoph Lendenfeld
00319f70d0 Merge branch 'blender-v4.3-release' 2024-10-31 17:41:04 +01:00
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