Commit Graph

108254 Commits

Author SHA1 Message Date
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
Falk David
614a23e9f6 Fix: BLI: Bounds is_empty function
This was meant to be the same as `BLI_rct*_is_empty`
but wasn't because the `less_or_equal_than` was
effectively doing a logical "and", when it should have
been doing a logical "or".
2024-03-29 17:12:51 +01:00
Falk David
60e648a7e6 Fix: GPv3: Simplify modifier inconsistency with GPv2
The simplify modifier did not remove points in fixed mode
at level 1. This was the case in GPv2.
This makes sure to get the same result as in GPv2.
2024-03-29 16:48:36 +01:00
Clément Foucault
7797231c6d EEVEE-Next: Shadow: Add LOD system to directional clipmap shadows
This act in multiple phases:

- A shader scan the whole clipmap after tilemap finalize to gather
where valid tiles from lower LODs are available and write the page
location and LOD offset at invalid tiles location.

- At sampling time we add the LOD offset before the pixel page
modulo operation. This offset is equal to the amount of pages of
the **sampling** LOD needed to have the same modulo result as the
**sampled** LOD.

The whole thing being very tricky, I added a lot of unit testing.

This has no use for now but the system is needed to implement:
- Shadows from Volumetrics at lower cost & memory footprint.
- Fixing soft shadows artifacts.

These will be implemented in separate PRs.

Pull Request: https://projects.blender.org/blender/blender/pulls/120031
2024-03-29 16:22:55 +01:00
Falk David
96de8112ee Fix: GPv3: Crash in simplify modifier
The simplify modifier uses
`bke::curves_copy_point_selection` but didn't
build the `points_to_keep` index mask correctly.
This fixes the indices in the index mask and also
optimizes the edge cases of removing all the points/
keeping all the points.
2024-03-29 16:13:44 +01:00
Hoshinova
c78c6b0bdf Fix #119797: Noise Texture Precision Issues
The Perlin noise algorithms suffer from precision issues when a coordinate
is greater than about 250000.

To fix this the Perlin noise texture is repeated every 100000 on each axis.
This causes discontinuities every 100000, however at such scales this
usually shouldn't be noticeable.

Pull Request: https://projects.blender.org/blender/blender/pulls/119884
2024-03-29 16:12:23 +01:00
Hans Goudey
8dbee79844 Fix: Debug build error after recent commit 2024-03-29 10:51:54 -04:00
Hans Goudey
a78d4f31be Cleanup: Add detail to sculpt mesh variable name
Generally sculpt uses a combination of data from the original,
deformed, and final evaluated meshes. Keeping track of all that
is confusing and using a more specific variable name helps a bit.
2024-03-29 10:05:05 -04:00
Brecht Van Lommel
d99f2e8eb7 Refactor: Add ability for UI block to own operator
Instead of only referencing an existing one. This will be used for
collection exporter and presets, to make sure the operator instance
stays alive long enough for the preset to be able to be applied.

Pull Request: https://projects.blender.org/blender/blender/pulls/120034
2024-03-29 14:52:35 +01:00
Brecht Van Lommel
bef3a7b978 Fix: Operator properties don't undo when owner is collection
For collection export, we need operator properties to not assume they
are owned by the window manager.

Pull Request: https://projects.blender.org/blender/blender/pulls/118855
2024-03-29 14:49:04 +01:00
YimingWu
127f879be9 GPv3: Tint tool
This implements the tint tool from GPv2.

Pull Request: https://projects.blender.org/blender/blender/pulls/119323
2024-03-29 12:43:15 +01:00
Falk David
5ce54fbd25 Fix: GPv3: Use const reference to avoid copy
This was resulting in a copy of the layer, which shouldn't
be done.
2024-03-29 12:02:00 +01:00
Sergey Sharybin
adaa55cecc Cleanup: Code formatting
Pull Request: https://projects.blender.org/blender/blender/pulls/120055
2024-03-29 11:58:14 +01:00
Sergey Sharybin
d174959759 Fix #120051: Crash when using shrinkwrap with Target Normal Project
The issue was introduced by b35831ad6c.

Since that commit `tree->boundary` will always be non-nullptr, even
when the target mesh had no boundaries. Some code was still relying
on the fact that `tree->boundary != nullptr` means the mesh has
boundary.

Update shrinkwrap code for this fact, avoiding access past array
boundaries.

Pull Request: https://projects.blender.org/blender/blender/pulls/120054
2024-03-29 11:43:15 +01:00
casey bianco-davis
7669ba7a5c GPv3: Handle UVs in Smooth Modifier
The smooth modifier was made before UVs were implemented.
This adds smoothing to the UV rotations.

Pull Request: https://projects.blender.org/blender/blender/pulls/120032
2024-03-29 11:18:06 +01:00
Campbell Barton
4365d0496a Cleanup: use a const pointer for unit-settings 2024-03-29 16:37:36 +11:00
Campbell Barton
e04aa7c188 Cleanup: remove unit scale initialization in UI logic
Versioning logic was added since 2.5x
2024-03-29 16:30:08 +11:00
Campbell Barton
3d2593b229 Cleanup: replace "derived mesh" with "evaluated mesh" in code comments
References to the evaluated mesh were referring to "derived mesh"
when DerivedMesh wasn't used.
2024-03-29 13:29:30 +11:00
Hans Goudey
ce9970c76b Cleanup: Remove duplicate function for copying edit mesh positions 2024-03-28 21:43:32 -04:00
Jesse Yurkovich
f62f8852dc Cleanup: Remove BLI_array macros in editmesh_knife
This replaces the older dynamic c array macros with blender::Vector in
editmesh_knife. This area is 1 of only 2 remaining which use this
machinery.

See #103343

Pull Request: https://projects.blender.org/blender/blender/pulls/119976
2024-03-29 01:51:55 +01:00
Harley Acheson
6dd0f6627e UI: Removal of Five Operator Confirmations
Removal of confirmation dialogs for the following five operators. For
each of these the UI module felt that they are all either very explicit
actions and/or are easily undone.
* ARMATURE_OT_separate (Move selected bones to a separate armature)
* CURVE_OT_separate - “Move selected points to a new object”
* OBJECT_OT_vertex_parent_set (Parent selected ob to selected vertices)
* OBJECT_OT_parent_no_inverse_set (Make Parent w/o inverse correction)
* FILE_OT_directory_new - (Create New Directory)

Pull Request: https://projects.blender.org/blender/blender/pulls/120036
2024-03-29 01:09:15 +01:00
Campbell Barton
01dceb6b89 Cleanup: remove redundant checks for known states 2024-03-29 10:30:42 +11:00
Campbell Barton
3cfd4b4aba Cleanup: simplify check for the existence of key-blocks
The active key was accessed to check if the key-blocks were empty,
the variable was then shadowed by the iterator.

Check if the key blocks list is empty instead.
2024-03-29 10:13:06 +11:00
Sean Kim
6e997cc757 Sculpt: Add Line Hide tool
This PR adds the *Line Hide* tool and the corresponding
`PAINT_OT_hide_show_line_gesture` operator to Sculpt Mode.

*Line Hide* supports common modal functionality including:
* Snapping to angles
* Flipping the selection area
* Moving selection area

Addresses one of the tools in #80390

Pull Request: https://projects.blender.org/blender/blender/pulls/119671
2024-03-29 00:05:25 +01:00
Hans Goudey
82b88f130a Cleanup: Use const for evaluated cage meshes and related data
Also access the evaluated deform mesh with a function rather than
directly from object runtime data. The goal is to make it easier to use
implicit sharing for these meshes and to improve overall const
correctness.
2024-03-28 18:57:57 -04:00