Using array_utils::gather inside an already parallel context with TLS
variables has the possibility of causing data corruption due to task
stealing.
This commit changes them to the sculpt specific gather_mesh_data call
to avoid the nested parallel loop issue.
Pull Request: https://projects.blender.org/blender/blender/pulls/129770
Currently writing to the curve type attribute directly from Python
doesn't work because it doesn't tag the curve topology changed.
This is a limitation with the Python attribute API that needs to be
solved generally. In the meantime, this commit adds a `set_types`
RNA function. This will have better performance than writing to
the attribute directly anyway.
This is an alternative to #128410 that avoids tying the type to the
addition of curves.
Pull Request: https://projects.blender.org/blender/blender/pulls/129224
All the OSL matrix functions had been implemented using the
`Transform` utility of Cycles, but that's built around a 4x3 matrix,
when the OSL matrix functions are working with 4x4 matrices.
This resulted in them not producing results consistent with the
CPU implementation.
This fixes that by making use of the `ProjectionTransform` utility
of Cycles instead, because it's built around a 4x4 matrix. Since
matrix inversion is required, I had to make a few more utility
functions available on the GPU (except Metal, due to use of
references/pointers without specification) that were previously
CPU-only.
Co-authored-by: Brecht Van Lommel <brecht@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/110102
Don't try to use MetalRT by default unless the device explicitly reports that RT is supported. We shouldn't just rely on an assumption that it's supported for M3 and beyond, ad infinitum.
Pull Request: https://projects.blender.org/blender/blender/pulls/129688
This was caused by uninitialized values at border. The correct
number of bricks were reserved but only the unpadded volume
was uploaded. Which was not touching the data of the border
bricks if the size was divisible by `IRRADIANCE_GRID_BRICK_SIZE - 1`.
Fix#127215
Pull Request: https://projects.blender.org/blender/blender/pulls/129810
Add an operator (`anim.debug_channel_list`) that lists animation channel
info in the terminal.
It's only available in debug builds of Blender, because it's a
developer-only tool. It is not available in a menu, just in the F3
search.
Pull Request: https://projects.blender.org/blender/blender/pulls/129804
In the Dope Sheet, show regular keyframes for GreasePencil object data.
The GPv3 transition missed a few cases in the animation
channel/filtering code to add the channels from regular Actions on
GreasePencil data blocks.
Pull Request: https://projects.blender.org/blender/blender/pulls/129807
First issue is that `BKE_modifiers_uses_armature` wasnt working for GP
objects and the second one is that vgroup names are stored in
CurvesGeometry for GP (so that needs special handling, now done, same as
in `BKE_object_defgroup_set_name`).
Pull Request: https://projects.blender.org/blender/blender/pulls/129794
Accidentally added in d70b10dcd4 and moved in dc652aeedb, the
`GREASE_PENCIL_OT_stroke_trim` operator is meant for usage in draw mode
(as the Cutter tool), but not in editmode. It is not the same as the
GPv2 Trim operator, see 4fbef3dc6b
To resolve, remove this from the menu again.
Pull Request: https://projects.blender.org/blender/blender/pulls/129805
Blender crashes when opening files that invokes the interactive
compositor on file load with a BadAccess X_GLXMakeCurrent error.
This is caused by the same system GPU context being active in two
threads at the same time, which happens when the GPU context for the
compositor is created in the main thread, it is made current during
creation, but it is not reset to the main GPU context of the drawable
because it is null. So when the GPU compositor actually executes, it
makes the GPU context current again but in its own thread, causing a
BadAccess error in X11 and potentially other window systems.
So the root cause is that the drawable is nullptr, and an attempt to fix
this was committed in 0a70360eb6 but was reverted in 98722773da because
it caused serious issue that were not obvious.
This patch attempts another fix by simply releasing the system GPU
context created when calling the RE_system_gpu_context_ensure. This is
more robust anyways because callers do not expect the context to be
bound form an API point of view.
Pull Request: https://projects.blender.org/blender/blender/pulls/129793
Curve maps in nodes like RGB Curves are not drawn nor evaluated outside
of clipping range. This is a regression in 8812be59a4, where the range
of the curve didn't account for points that lie outside of the clipping
range. That's because the table_range variable was initialized before
the loop that updates the minimum and maximum points of the table.
To fix this, we move the table_range initialization after the loop that
updates the minimum and maximum points of the table.
Pull Request: https://projects.blender.org/blender/blender/pulls/129777
Build modifier should start building strokes at a key frame, not always
assume a starting frame of 0.
Frame restriction works the same way as GPv2, which uses absolute
frame number.
Pull Request: https://projects.blender.org/blender/blender/pulls/129774
When grease pencil has no actions (ale->adt), id data block channel is
still added due to `ANIMFILTER_ANIMDATA`. This would lead to crash if
operator is accessing the AnimData (ale->adt). To fix this, make sure
adt exists before creating an animchannel.
Pull Request: https://projects.blender.org/blender/blender/pulls/128841
The 4x4 matrix type has a larger alignment requirement of 16 bytes
than the default, but it was stored in a generic vector of bytes. There
are a few solutions that reduce the memory reuse in this code path--
the chosen solution uses a custom allocator which always allocates
with an alignment that should be large enough for anything.
Generally I think this resampling loop could be rewritten to be a bit
simpler, avoiding these problems in the first place. Some performance
testing would show whether this "fancy" memory use between types
and loop structure is actually worth it. For now though, just correcting
the existing logic seems like the best choice.
Pull Request: https://projects.blender.org/blender/blender/pulls/129628
6c03339e48 moved from
rtcSetNewGeometryBuffer to rtcSetSharedGeometryBuffer but kept the
additional padding of 1 element in the function call.
It was previously used for over-allocating, to allow 16-byte reads of
all accessed elements, as Embree requires.
With rtcSetSharedGeometryBuffer, this argument led to an out-of-bounds
read as memory was already allocated without padding.
float3 is already 16-bytes so there is no need for padding, hence we
remove it.
We can also note that now, even when using rtcSetSharedGeometryBuffer,
over-allocating is not needed as it's done and functional on Embree side
since v3.6.
Pull Request: https://projects.blender.org/blender/blender/pulls/129643
The input `md_eval` is invalidated when calling `BKE_scene_graph_update_for_newframe`.
The fix uses `BKE_modifier_get_original` to pass the original modifier
to `apply_grease_pencil_for_modifier_all_keyframes` then calls `BKE_modifier_get_evaluated`
after `BKE_scene_graph_update_for_newframe` to ensure the `md_eval` pointer is valid.
Pull Request: https://projects.blender.org/blender/blender/pulls/129732
This commit adds Epoxy as an explicit library requirement for
`intern/opensubdiv`, which uses it in `gl_compute_evaluator.cc`.
This fixes build errors where lite builds that additionally enabled
OpenSubdiv would fail to link due to missing Epoxy symbols. This
problem did not occur in regular release builds due to other CMake
modules adding Epoxy to the library link path in place of OpenSubdiv.
Pull Request: https://projects.blender.org/blender/blender/pulls/129740
Introduced in 1bc5c488d4
The value used in DNA_scene_defaults.h was out of sync with the actual
default startup value. In all currently supported and in development
versions (3.6 LTS, 4.2 LTS, 4.3, and 4.4), the `UNIFIED_PAINT_ALPHA`
bit value is set to false.
Pull Request: https://projects.blender.org/blender/blender/pulls/129711
Update Harfbuzz from version 5.1.0 to 10.0.1.
The current version of Harfbuzz (5.1.0) fails to build on Clang 16.0 and
above, breaking dependency builds on macOS 15.0 (which bumped the
Apple Clang version to 16.0). This is due to a new Clang warning flag
(`cast-function-type-strict`) which Harfbuzz implicitly enables and
treat as an error via a header pragma, which in turn prevents it from
being disabled via a simple `-Wno-error` flag.
Since Harfbuzz was only added as a preliminary dependency, and isn't
used anywhere in the Blender codebase yet, it was decided on the chat
that the simplest course of action would be to just bump it to its
latest version, as the problematic warning flag has been disabled in
version 6.0
Pull Request: https://projects.blender.org/blender/blender/pulls/128922
This commit adds Epoxy as an explicit library requirement for
`intern/opensubdiv`, which uses it in `gl_compute_evaluator.cc`.
This fixes build errors where lite builds that additionally enabled
OpenSubdiv would fail to link due to missing Epoxy symbols. This
problem did not occur in regular release builds due to other CMake
modules adding Epoxy to the library link path in place of OpenSubdiv.
Pull Request: https://projects.blender.org/blender/blender/pulls/129740
This extends the `Vector` API to support transfering ownership of a memory
buffer to and from a `Vector`. This reduces the need for unnecessary copies in
some cases which converting between data-structures. A new
`VectorSet::extract_vector` method is added that takes O(1) time. Previously,
this was only possible in O(n) time by copying the entire array.
The `Vector::release` method can be used to e.g. build a vector with the C++
container, but then extract it for use in DNA data.
Pull Request: https://projects.blender.org/blender/blender/pulls/129736