Commit Graph

104651 Commits

Author SHA1 Message Date
Hans Goudey
768c68f19b Fix #120179: Assert failure after sculpt trim operation
Seems to be caused by c53e220aef. I didn't think our PBVH building would
ever create a node with no triangles, but I guess I was wrong, since I
checked and the PBVH is clearly being rebuilt after the trim operation,
so it seems there isn't anything else weird going on here.

Rather than trying to figure that out, I'll just add the empty check
back here. Eventually we should completely replace the algorithm that
creates the PBVH nodes anyway.
2024-04-02 17:58:36 -04:00
Hans Goudey
d001302200 Fix #117709: Crash with single point NURBS curve
The root of the issue seems to be calling `BLI_snprintf` with the
wrong number of arguments in the `MorePointsForBezierRequired`
case. The fix arguably makes things simpler anyway: just use a
separate call in each case of the switch.
2024-04-02 17:44:49 -04:00
Hans Goudey
bf2b684913 Cleanup: Remove unused variable after recent cleanup 2024-04-02 17:41:27 -04:00
Sean Kim
d80b8cbcdc Cleanup: Add doxygen sections to sculpt_face_set.cc
This PR adds doxygen headers to `sculpt_face_set.cc`

Pull Request: https://projects.blender.org/blender/blender/pulls/120190
2024-04-02 23:13:52 +02:00
Iliya Katueshenock
3f3df16ba2 Cleanup: Mesh calculate edges file cleanup
Trivial changes of code:
1. Const correctness.
2. Arguments order.
3. Use regular constructor instead of aggregate one.
4. Replace stateful iterators of corners by `bke::mesh` functions.
5. Offset Indices instead of manual prefix sum.
6. Slight changes of iterator names which is affected by cleanup.
7. Cpp allocator.
8. Explicit template parameter.

Pull Request: https://projects.blender.org/blender/blender/pulls/120189
2024-04-02 22:48:58 +02:00
Hans Goudey
89d38cf008 Cleanup: Use ImplicitSharingInfo type instead of C handle 2024-04-02 16:40:33 -04:00
Harley Acheson
d1b6621903 UI: Complete Event Icon Coverage
This PR completes coverage of the event icons used to represent keymap
entries on the status bar. This adds 0-9, non-alpha keys, tablet, F13-
F24, NDOF buttons, etc.

Pull Request: https://projects.blender.org/blender/blender/pulls/120117
2024-04-02 21:52:57 +02:00
Harley Acheson
65bfae2258 UI: Status Bar Keymap Spacing
Adjustments to the spacing of keymap items shown in the status bar
while idle and during modal operators. Decreased space between icon
and related text makes each item have better separation.

Pull Request: https://projects.blender.org/blender/blender/pulls/120124
2024-04-02 21:25:56 +02:00
Hans Goudey
930d645b4c Fix #120154: Cage face normals overlay always draws original normals
When the cage mesh is the output of a modifier that supports deforming
BMesh directly, it will be a mesh wrapper and `MR_EXTRACT_BMESH` will
be used. Otherwise the cage mesh will be a `Mesh` and its own normals
should be drawn instead of the the original normals. Thought this seems
deceivingly simple, it works with no modifiers, BMesh-deforming modifiers
with cage enabled and disabled, and topology changing modifiers, which
should be all the possible cases here.
2024-04-02 13:42:06 -04:00
Sean Kim
6160335c4d Cleanup: Extract common functions in sculpt_trim.cc
This PR extracts a few common functions for operations
in `sculpt_trim.cc` to reduce duplication.

Pull Request: https://projects.blender.org/blender/blender/pulls/120180
2024-04-02 19:38:37 +02:00
Omar Emara
5de40790d0 Compositor: Set W to 1 in Float to Vector conversion
Set the w component to 1 in Float to Vector implicit conversion for the
Realtime Compositor. That's because the Vector Output node expects a
vector for the velocity input, but the CPU compositor fakes it as a
color input, while assumes a fourth component of 1.
2024-04-02 18:10:13 +02:00
Jacques Lucke
77a34791a3 Fix #119938: performance regression when adding output attribute
Avoid calling `modify_geometry_sets` because this can potentially result in
additional data copies when the geometry references the final mesh of other objects.

For more details, see https://projects.blender.org/blender/blender/issues/119938#issuecomment-1155109.

This implements a special case to avoid the regression until e.g. #119968 is done.

Pull Request: https://projects.blender.org/blender/blender/pulls/120177
2024-04-02 17:48:03 +02:00
Falk David
45a0b6cc1a Cleanup: GPv3: Use const in a few places 2024-04-02 16:40:00 +02:00
Christoph Lendenfeld
8a1c2b172a Fix: Escape property name when keying
The property name can contain `"` which would cause keyframing to
fail. By escaping it those properties can now be keyframed.

E.g. property names like `"test"` now properly receive keys.

Pull Request: https://projects.blender.org/blender/blender/pulls/119922
2024-04-02 16:24:59 +02:00
Jacques Lucke
7400927ada Fix #120084: custom group node remains undefined after registering node type 2024-04-02 16:07:48 +02:00
Falk David
ca0b02aa96 Fix: GPv3: Crash rendering cyclic strokes with single point
Creating the batch cache for rendering crashes when
there is a stroke with one point that is set to cyclic.
There was a missing check for the number of points
because we're accessing the curve lengths, which
needs at least 2 points to be populated.
2024-04-02 15:51:26 +02:00
Jacques Lucke
7ed713e772 Fix #120087: wrong node selection after duplicating node 2024-04-02 15:40:51 +02:00
Jacques Lucke
6f6ab91dbf Fix: support parallel_for_each with IndexRange without TBB 2024-04-02 15:12:37 +02:00
YimingWu
4f4e8381ee Fix #120164: GPv3: Update points range after trimming
In `process_stroke_end`, an end point that has a thickness of 0 will be
removed, but the `IndexRange` for points isn't updated, leading to wrong
slicing downstream.

Pull Request: https://projects.blender.org/blender/blender/pulls/120165
2024-04-02 13:50:59 +02:00
Aras Pranckevicius
19ce05971d Fix #120077: Video output artifacts due to threaded YUV conversion
ffmpeg AVFrame objects should use correct alignment between image
rows, or otherwise bad things might happen. In this particular
case, multi-threaded libswscale RGB->YUV conversion was trampling
over 4 bytes of V plane, for each thread boundary.

Pull Request: https://projects.blender.org/blender/blender/pulls/120168
2024-04-02 13:03:05 +02:00
Omar Emara
fd7e74aa23 Compositor: Retain alpha in Color to Vector conversion
Retain the alpha channel in Color to Vector implicit conversion for the
Realtime Compositor. That's because speed passes are exposed as color
sockets, so connecting them to a node like Vector Blur will lose the
y component of the next vectors.

The CPU compositor handles that by faking vector sockets as color
sockets internally, while the realtime compositor does not do that.
2024-04-02 12:35:12 +02:00
Sebastian Parborg
658eba4b2e Fix #119966: File rename fails on Mac with certain filesystems
As in the Linux case, it seems like the atomic rename doesn't work on all file systems on Mac either.
We did test on Windows and it seems like there is a built in fallback, so we don't need to do this there.

Pull Request: https://projects.blender.org/blender/blender/pulls/120037
2024-04-02 12:27:36 +02:00
Campbell Barton
16a1c2e33f Fix error copying a grease pencil strokes fill opacity
The destination value was set to itself.
2024-04-02 17:44:30 +11:00
Hans Goudey
32fc3c0c1c Fix: Resolve over-allocation for mesh tangents
For some reason, the custom data type was set as `float[4][4]`
for tangents, but they are written as `float[4]`. The overallocation
might not have been a problem, since it looks like the extra memory
was never written to. But it's still confusing and potentially bad for
performance.
2024-04-01 13:38:06 -04:00
Jacques Lucke
7934ebd4e4 Fix: baking simulation only bakes a single frame
When using the bake button in a simulation zone, it currently only bakes a single frame.
Still baking only works in the Bake node.

Pull Request: https://projects.blender.org/blender/blender/pulls/120138
2024-04-01 17:59:29 +02:00
Hans Goudey
935666a622 Fix #120104: Snap ignores evaluated geometry bounds
Previously the bounds were accessed on the original object.
That used to implicitly get the evaluated geometry's bounds,
but now that is an explicit choice.
2024-04-01 11:01:19 -04:00
Hans Goudey
f0d7a05fc4 Fix #120065: Mesh tangent draw extraction crash
Since the code was added, it used the active indices of the input and
output custom data layers incorrectly. 82b88f130a exposed that
by actually modifying the active indices of the ouput custom data
correctly, but it didn't update a couple other places to take that into
account.
2024-04-01 10:48:43 -04:00
Germano Cavalcante
ea3f938c07 Fix #120109: Grid snap crash when locking axis before base selection
The functionality of snap with constraints relies on the position of
the transformed object.

Previously, snap to grid with constraints was restricted to the Move
operation.
Consequently, the 'Set Snap Base' mode, as well as other transformation
modes, failed to compute the moved position.
As a result, it lacked support for snap to grid with constraints and
would even crash under such circumstances.

The solution involves eliminating the reliance on the Move operator and
instead calculating the position based on mouse position.
2024-04-01 11:22:03 -03:00
Omar Emara
0b1dc351e4 Fix: eGPUBarrier enum negate operator is broken
The ENUM_OPERATORS macro for the eGPUBarrier enum uses
GPU_BARRIER_UNIFORM as its maximum value, while it should be
GPU_BARRIER_BUFFER_UPDATE instead.
2024-04-01 16:14:23 +02:00
Omar Emara
2d6aae8011 Fix: Vector Blur node produce wrong output sometimes
The Vector Blur node sometimes produces wrong output. That's because no
proper memory barriers existed for the SSBO written to by the velocity
dilation pass, so ensure a proper barrier exist.
2024-04-01 16:04:49 +02:00
Omar Emara
62b39c14a3 Fix: Vector Blur node has blocky artifacts
The Vector Blur node has blocky artifacts. That's because one of the
buffers used in the velocity dilation pass was not zero initialized,
while it was written to using atomic max operations, so make sure it is
zero initialized.
2024-04-01 16:01:53 +02:00
Omar Emara
3fe4665b6d Fix: Memory leak Vector Blur node
The Vector Blur node has a memory leak. An output for the velocity
dilation pass was allocated but was never used or release, so we just
remove it.
2024-04-01 15:59:52 +02:00
Campbell Barton
99a60dd6c1 BLI_convexhull_2d: correct ifdef check
the check for USE_ANGLE_ITER_ORDER_ASSERT was flipped.
2024-04-01 23:58:52 +11:00
Campbell Barton
d514b3b53b Cleanup: use explicit casts when assigning booleans to floats
While valid, this isn't so common and cppcheck warns about this,
use explicit casts to suppress the warning, also correct "true"
being assigned to a float value.
2024-04-01 22:20:09 +11:00
Campbell Barton
fc266730a2 Cleanup: use 2x copy calls for camera_uv_scale/camera_uv_bias
One copy_v4_v4 call was used to initialize both camera_uv_scale &
camera_uv_bias, replace this with 2x copy calls since passing in
smaller buffers to copy functions is typically an error.
2024-04-01 22:20:09 +11:00
Campbell Barton
7ce68904eb Cleanup: replace suspicious use of "&" with "&&" 2024-04-01 22:20:09 +11:00
Campbell Barton
fa4fdbf356 Cleanup: remove repeated flags in bit-flag literals 2024-04-01 22:20:09 +11:00
Campbell Barton
7e5a712e58 Cleanup: remove redundant null pointer checks
Based on the surrounding context these checks aren't needed.
2024-04-01 22:20:09 +11:00
Campbell Barton
ace64dbf50 Fix potential null pointer de-reference
Refactoring &
2024-04-01 22:20:09 +11:00
Campbell Barton
04b6fe78e7 Fix integer truncation when calculating int64_t values
Large int64_t values were calculated and assigned int however the
calculation was performed on integer types which would truncate the
result before casting to an in64_t.
2024-04-01 22:19:36 +11:00
Campbell Barton
937776b555 Cleanup: sort CMake file lists 2024-04-01 16:48:44 +11:00
Campbell Barton
2be407fc82 Cleanup: spelling in comments 2024-04-01 16:47:57 +11:00
Campbell Barton
add3c6a3b1 Correction to commenting unused axis_v from last commit 2024-04-01 15:51:35 +11:00
Campbell Barton
3ecc626c3d Cleanup: comment unused variable 2024-04-01 15:48:35 +11:00
Campbell Barton
aa308e166a Cleanup: ensure types signatures match for all custom RNA functions
Assign typed function variables to ensure the function signatures
always match. This avoids ambiguity when types don't match and ensures
any discrepancies are caught early.

It also helps when changing types to ensure all callbacks have been
updated.
2024-04-01 15:38:09 +11:00
Campbell Barton
4855f8cd9c BLI_convexhull_2d: optimize rotating calipers
Previously the hulls edges were simply iterated over causing the
rotating calipers to step over points 4x as many times as is needed.

Avoid this by adding angle stepping logic that maps all angles to a
single quadrant, reducing the checks needed to advance the calipers
to each new angle. This gives ~1.4x speedup to AABB fitting logic.

Also add a test for octagon shapes to ensure axis aligned edges work
as expected.
2024-03-31 22:47:23 +11:00
Campbell Barton
7c4b2ec722 BLI_convexhull_2d: adjust order of edge iteration
Begin testing the edge edge between indices [0, 1] indices,
instead of [last, 0]. This only ever makes a difference as a tie breaker,
where [0, 1] is now prioritized.

This minor change simplifies further optimizations.
2024-03-31 22:39:14 +11:00
Campbell Barton
c76eed6717 Unbreak build WITH_TBB disabled
It may be possible to support this case with the non-TBB template,
for now keep the build working.
2024-03-31 21:32:40 +11:00
Lukas Tönne
d7c718dfd4 GPv3: Texture offset modifier
Port of the GPv2 texture modifier for transforming UVs of stroke points.

Pull Request: https://projects.blender.org/blender/blender/pulls/119050
2024-03-29 21:42:30 +01:00
Nika Kutsniashvili
47ced73952 UI: Rename VCols to Color Attributes in edit mesh operators
A couple of edit mesh operators are still using "VCols" terminology,
which should be Color Attributes now. This just renames text seen
in redo panels. Internally it's still called VCols.

Pull Request: https://projects.blender.org/blender/blender/pulls/120075
2024-03-29 19:30:25 +01:00