Commit Graph

134824 Commits

Author SHA1 Message Date
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
Campbell Barton cbee0f5477 cppcheck: update the checking utility to resolve issues in source/
The script to run cppcheck failed for most files in source/ because
of a syntax error in MEM_guardedalloc.h with attribute functions.

Workaround the error by including BLI_compiler_attrs.h directly.

Other changes:

- Specify c++17 / c11 standards for C++ & C.
- Resolve errors from undefined integer ranges.
- Set the check level to exhaustive so checks always run.
- Suppress noisy missingIncludeSystem warning.
- Move run-time compiler defines into a temporary include
  which resolves argument quoting errors when cppcheck is used with
  clang's parser.
2024-04-02 17:02:23 +11:00
Campbell Barton 97d93c7e33 GHOST/Wayland: pass in null when the cursor theme isn't set
While an empty string resolves to the default theme, it's not following
the API specification for wl_cursor_theme_load as it's written.

Checking on wayland internals this looks only to add an unnecessary
theme lookup on an empty string which falls back to the default.

Noticed when investigating #105895 although it seems unlikely
that this chagne would resolve the issue.
2024-04-02 15:11:05 +11:00
Campbell Barton 03d728e281 Cleanup: improve type checking in project_source_info.py
Since the type hints were added it seems mypy has been improved
making it possible to remove the workarounds.
2024-04-02 10:26:14 +11:00
Campbell Barton cf1849aedb Fix string formatting in git_log_review_commits_advanced dev tool 2024-04-02 10:17:54 +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 ae950451ea Cleanup: remove redundant f-string use 2024-04-01 16:51:32 +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
Aaron Carlisle 8d12c58f2c Docs: Use reference links when possible when linking to other API 2024-03-29 22:54:12 -04:00
Aaron Carlisle 7b4fa19fca Docs: Python: Add copy button to code blocks
Uses the sphinx-copybutton to add a copy icon to code block to quickly copy content to the clipboard.

Pull Request: #119948
2024-03-29 20:39:35 -04: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
Sebastian Parborg 6dfb1cdf22 Fix: Crash/Assert in the pusleaudio lib when pausing playback
After 91eb50ec2f, we would get random crashes/asserts from the pulseaudio library like:
`Assertion 'e->mainloop->n_enabled_defer_events > 0' failed at ../pulseaudio-17.0/src/pulse/mainloop.c:261, function mainloop_defer_enable(). Aborting.`

It seems like we would run into a race condition if we didn't guard the
pulseaudio flush command with the pulseaudio mutex.

This is probably because the pulseaudio thread would try to read the
buffer for a tiny bit even after pausing the playback.

Sadly the only way to reproduce this is to playback any scene (seem to happen more often if A/V sync is on) and spam play/pause.
Note that I could not reproduce this on every computer I tested this on.

But by expanding the main pulseaudio mutex lock, I can't seem to reproduce this anymore.
So I think that is the correct solution.

Pull Request: https://projects.blender.org/blender/blender/pulls/120072
2024-03-29 19:47:16 +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
Brecht Van Lommel bd1f4343c3 Build: Improve OSL library dependency handling in Cycles
Might fix some missing symbols when the OSL library gets updated.

Pull Request: https://projects.blender.org/blender/blender/pulls/119391
2024-03-29 15:24:30 +01:00
Hans Goudey 03cc78de31 Tests: Add modifier tests for shrinkwrap target normal project
This code didn't have regression tests yet. Add tests for #120051,
with meshes with and without boundary edges.
2024-03-29 10:11:22 -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