In the case of weight, tilt or radius (these dont don't change [handle]
positions), dont change the handle types.
See the doc for `BKE_nurb_handles_test` ("Use when something has changed
handle positions")
NOTE: a siilar check is done in `createTransCurveVerts`
Pull Request: https://projects.blender.org/blender/blender/pulls/129056
The root cause is that the editor functions
(`retrieve_editable_and_selected_points` etc.) use the evaluated object,
while the operator poll which checks for the active layer uses original
data. The geonodes modifier removes all GP layers. The operator runs
anyway because the original data has an active layer, but then crashes
layer when trying to access the layer in evaluated data.
The fix here is to use original data throughout, which is usually the
data we want to look at for edit/sculpt/paint tools. There is a caveat
that the internal functions like `calculate_view_positions` still should
be using evaluated data for some things, like finding intersections with
other visible strokes. This isn't distinguished clearly atm and might
cause further bugs down the line.
Pull Request: https://projects.blender.org/blender/blender/pulls/129109
In Pose copy/paste case, (almost) all dependencies of the armature
object are cleared during the copy phase (only its obdata Armature is
kept). This would also clear ID pointers from the liboverride data if
the source object is a liboverride.
While manual handling of such cases is possible, it's simpler here to
simply make the data in the pastebuffer fully local, since only the Pose
part of it is used anyway.
Runtime UID should be generated after other basic ID info is set, in
this case the `tag` flags were still the one read from file, which could
lead to an assert in `BKE_lib_libblock_session_uid_ensure` in case the
blendfile was generated from a temp main data-base.
This makes it so the stroke selection is taken into account by the
interpolation tool.
This does NOT use the selection _order_, just limits interpolation by
index to the selection. The result will be the subset of selected
strokes, excluding non-selected strokes, which is closer to the GPv2
behavior.
The `sample_curve_attribute` function was using the target curve index
for both the src and dst curves. This worked when all the curves are
interpolated, but with selections the dst curve is generally not the
same index as the src curve. The `from_curve_indices` array must be
passed along as well to retrieve the correct source index.
Pull Request: https://projects.blender.org/blender/blender/pulls/129096
Line art uses `DEG_OBJECT_ITER_BEGIN` to load all objects that has a
geometry in the scene, which is kind of a hack since the beginning. This
left potential problem where the iterator could go through some objects
that line art didn't have a dependency on (e.g. other grease pencil
objects):
- Since those "other" objects often evaluates fast enough, so
line art always end up having valid data from everywhere after lengthy
mesh evaluation prior to itself, so this problem was not prominent.
- However, in rare cases, there are other objects that takes a lot of
time to evaluate, this causes line art to potentially iterate to objects
that are still invalid.
This fix will build a `Vector<Object *>` during `update_depsgraph`, and
use such list inside `DEGObjectIterSettings` to filter out objects that
the modifier isn't dependent on, thus remove the possibility of reading
objects that hasn't been evaluated.
Since Line art will not add grease pencil objects as potential geometry
inputs, all mesh/curve types of geometries generated by geometry nodes
modifier directly inside other grease pencil objects won't be loaded.
This can be mitigated by having a third mesh object that reads the
result from the grease pencil object that generates geometries, then
directly output them for line art to read.
This also fixes#128888.
Pull Request: https://projects.blender.org/blender/blender/pulls/128890
Blender would crash in certain cases when using the `Set Curve Resolution`
operator to increase the curve resolution.
This was because the `evaluated_offsets_cache` was not tagged
to be updated. The fix makes sure to use `tag_topology_changed`
to tag the offsets cache as dirty.
Pull Request: https://projects.blender.org/blender/blender/pulls/129098
Instead of assigning `any_point_selected` to selection span elements,
pass `select` value if any point of that curve exists in vgroup.
Also renamed `any_point_selected`->`any_point_in_group`.
Pull Request: https://projects.blender.org/blender/blender/pulls/129035
The problem was that the screen space size of the brush was not updated.
This was not fully noticeable because the radius control operator was using
a not working scale correction.
The solution remove the scale correction and just update the brush size.
Note: This update currently happens when the cursor is drawn.
Pull Request: https://projects.blender.org/blender/blender/pulls/126773
The issue was that the shader `gpu_shader_gpencil_stroke_vert_no_geom.glsl`
assumed a wrong format of the color attribute (`uchar4` instead of `float4`).
The fix uses `vertex_fetch_attribute` with `float4`.
Pull Request: https://projects.blender.org/blender/blender/pulls/129072
GPv3 stores the vertex group inside `CurvesGeometry`.
When the object level vertex group name is changed, we have to loop over
the vertex group list of each drawing. If a matching name is
found, copy the new name to the vertex group in `CurvesGeometry`. A separate
function is created to handle this: `BKE_grease_pencil_vgroup_name_update`.
Pull Request: https://projects.blender.org/blender/blender/pulls/129038
When symmetrizing a bone using "Armature->Symmetrize" in Edit Mode,
Settings on the pose bone were not symmetrized. This patch symmetrizes
ONLY the setting mentioned in the bug report. (limit rotation Z)
IMO other settings should be reviewed on a 1 by 1 basis.
Do note that this assumes that the armature is symmetrized across the YZ-plane
Pull Request: https://projects.blender.org/blender/blender/pulls/129004
The issue was that the `merge_layers` function assumed that the
`src_grease_pencil` always returns a drawing when calling
`get_eval_drawing` which can return `nullptr`.
The fix makes sure to check that the `src_drawing` exists.
Pull Request: https://projects.blender.org/blender/blender/pulls/129074
The problem was that when removing FCurve modifiers via the python API
the Depsgraph wasn't notified.
Fixed by tagging the owner ID of the fcurve modifier for an update.
Pull Request: https://projects.blender.org/blender/blender/pulls/128984
When duplicating a bone (has to be done in edit mode)
the pose bone colors were not copied.
This adds the code to do just that
This also fixes it for symmetrising because that uses the
same code path
Pull Request: https://projects.blender.org/blender/blender/pulls/129007
Regression in [0] although prior to this the `deformed_only` was not
being set, caused by a separate regression.
[0]: 80fa49f24ae768c5869065363e116b51175fb2df
Regression in [0] caused the outliner not to draw at the clamped scroll
position. This meant searching in the outliner could show no results
even when results were found. It also meant deleting objects could show
nothing until the user manually forced the outliner to redraw.
Workaround the problem by detecting when outliner drawing changes the
scroll position and draw again. While inelegant this doesn't happen
often in practice.
Fixing without a second draw likely involves resolving the order of
initialization problem by separating bounds calculating from drawing.
[0]: a63ac425d0
The `u_scale` should be given a default value of `1.0f` so that newly drawn
strokes with the drawing already having `u_scale` attributes will have
correct texture mapping size instead of a default of `0.0f`.
Pull Request: https://projects.blender.org/blender/blender/pulls/129060
The build modifier crashes when getting lengths of cyclic curves because `evaluated_points_by_curve`
was previously always called with `cyclic` parameter set to `false`.
The `cyclic` parameter necessary for `curves::segments_num` to return correct number of segments.
Pull Request: https://projects.blender.org/blender/blender/pulls/128955
Caused by 364d62e59b.
In draw mode, we want to make sure to show vertex colors by default
because users can draw with them. Otherwise this can lead to unexpected
behavior in solid shading mode when vertex colors used to not be
rendered in draw mode.
The previous fix tried to do this by enforcing the `V3D_SHADING_VERTEX_COLOR`
mode in draw mode. But this has the side effect that the material
stroke and fill color are overriden with pure white.
To fix the issue correctly, simply ensure that `vert_col_opacity` in
`grease_pencil_layer_cache_add` is set to 1.0f. This means that
vertex colors and material colors are shown just like in the render.
Also resolves#128680.
Pull Request: https://projects.blender.org/blender/blender/pulls/129054
Intel Windows drivers for 10th gen and lower has some strange behavior
when using dynamic rendering. It requires pipeline conditions to be met,
when beginning a new rendering scope. This is strange as specs + VVL
notes that these conditions should be met during vkCmdDraw* commands.
Pull Request: https://projects.blender.org/blender/blender/pulls/129055
This change makes unused attachments extension optional.
This extension is fairly new and not all drivers have support for it.
The workaround will create additional pipelines when attachments are
not set.
Pull Request: https://projects.blender.org/blender/blender/pulls/129046
It looks like this specific case never really worked. This wasn't found before,
because in the large majority of cases, execution uses a more optimized code
path instead of this general one.
Pull Request: https://projects.blender.org/blender/blender/pulls/128993
During development of Collection Export, it was noticed that our various
IO formats deal with errors in vastly different ways [1]. The crashes
were all fixed but now the motivating scenario is as follows:
If you setup a Collection Exporter for OBJ, STL, or PLY, and if it
runs into an error during processing, the C++ operator will return
"FINISHED" to the caller but the operator will also RPT_ERROR. This
causes the caller, Collection Export, to indicate "success" to the user
but the RPT_ERROR then causes a UI report that indicates failure.
This PR chooses to use the presence of the RPT_ERROR as indication of
"CANCELLED" operator status and should be safe enough to also apply
to 4.2 LTS.
This aligns with what Python does [2] and with what the new GSoC import
nodes have chosen to do [3]. Though doing this on import isn't quite
correct so this PR does not add that in to the base import operators.
Alembic and USD are better behaved in this scenario already. However,
they have their own quirks to follow-up afterwards.
[1] https://projects.blender.org/blender/blender/issues/117881
[2] https://projects.blender.org/blender/blender/src/branch/main/source/blender/python/intern/bpy_capi_utils.cc#L25
[3] https://projects.blender.org/blender/blender/src/branch/main/source/blender/nodes/geometry/nodes/node_geo_import_obj.cc#L49
Pull Request: https://projects.blender.org/blender/blender/pulls/127525
Any brush that used the `restore_position_from_undo_step` codepath (i.e.
brushes that use `OrigPositionData` to calculate their deformations) had
the possibility to cause artifacts due to the nested tbb parallelization
causing incorrect usage of TLS data.
To fix this we add a call to `threading::isolate_task` to prevent thread
stealing.
Pull Request: https://projects.blender.org/blender/blender/pulls/129020
The brush does not use the value calculated from brush_strength, this
commit silences the assert by just handling the case statement for this
brush type with a static value of 0.0f.
Pull Request: https://projects.blender.org/blender/blender/pulls/128936
Followup to 682161283e.
This type better reflects the intention of a read-only string reference,
and `std::string` should usually be used for owning string variables
only.
The tool-tip generated for FileHandler drag-n-drop may be obtained from a
different context where the dropbox poll function is invoked, which could
generated an incorrect tool-tip since FileHandlers are polled again in a wrong
context.
This can be solved by ensuring the same context is used, however the tool-tip
could be drawn in different windows.
To avoid undefined tool-tips , this generates the tool-tip in place when the
dropbox poll function is invoked.
Pull Request: https://projects.blender.org/blender/blender/pulls/125037
VK_EXT_dynamic_rendering_unused_attachments is required for correct working.
Renderdoc hides this extension, but most platforms do work. However the
Windows Intel driver crashes when using iGPUs; they don't support this
extension at all.
This change does a more strict extension test so drivers that do not
support this extension will fallback to OpenGL. When using renderdoc it
is now allowed to compile blender with `WITH_RENDERDOC=On`.
Future developments are needed to add support for Intel iGPUs on
Windows.
Pull Request: https://projects.blender.org/blender/blender/pulls/128986
Resources are shared, when running multiple contexts on the same thread.
Cycles uses the same context on multiple threads and expected same resources.
This change will introduce a single render graph per context and an updated
resource management. Render graphs are not shared anymore; Resource pools
are still shared, but garbage collection depends on the thread and if
background rendering is used.
Pull Request: https://projects.blender.org/blender/blender/pulls/128983
Cycles uses multiple threads to send commands to the GPU. The current
command buffer structure assumed that all commands from the same context
were send via the same thread. This wasn't the case and could lead to
recording commands to command buffers that are still pending (preparing
commands to send to GPU).
This is fixed by creating a command buffer each time a render graph
submits its work.
Detected when researching #128608
Pull Request: https://projects.blender.org/blender/blender/pulls/128978
When allocating a host visible buffer it could be that the returned
buffer was not host visible and access to the buffer would write to
unallocated memory.
Detected when researching #128608
Pull Request: https://projects.blender.org/blender/blender/pulls/128977
When using cycles in the viewport there it uses render threads and
workers to update the viewport. All threads can record commands to the
queue and needs to be synchronized. This didn't happen leading to
incorrect renders.
Detected when researching #128608
Pull Request: https://projects.blender.org/blender/blender/pulls/128975
Multiple threads can access the same device queue from different
threads. This could happen when doing a cycles preview render, baking
eevee volume probes or generating material previews.
This PR adds a mutex around access to the device queues.
Detected when researching #128608
Pull Request: https://projects.blender.org/blender/blender/pulls/128974
These attributes are not guaranteed to exist. So they should either be used
conditionally, or with a fallback value. The fallback value for the opacity is
obvious, but for the radius it's more tricky. There is not a consistent fallback
value across Blender unfortunately. The one I used here is used in a couple of
places.
Pull Request: https://projects.blender.org/blender/blender/pulls/128847
# Fix 128078, Part I: Fix missing reverse endian switch of Action's `idroot`.
ID type code stored as ints (or shorts) need their endian switch to be
reverted (in case there is endianess conversion) on file read.
Interestingly, this was done for the deprecated IPO data (among others), but
not for the Action one!
NOTE: There is no versioning fix for this mistake, i.e. old files that
were saved from a BE system, then opened and re-saved from a LE system,
will still have totally invalid ID code values. This is not considered
as necessary currently, given that this `idroot` value is only
'informational' and not relied on by any part of the code.
# Fix 128078, Part II: GPv3 conversion code missing animation of Layers' location.
Also add code to the AnimDataConverter to ensure that actions get the
`idroot` matching their new ID owner type in GP data case.
Pull Request: https://projects.blender.org/blender/blender/pulls/128129
The layer/material/vertex group filter properties had already been added but they were
not exposed in the UI. Also the influence panel was missing. Now added in "rna_" function
of the modifier.
Pull Request: https://projects.blender.org/blender/blender/pulls/128973