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
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
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.
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
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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
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
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".
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
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.
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
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.
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