Commit Graph

113808 Commits

Author SHA1 Message Date
Philipp Oeser
7e720a8dd6 Fix #127195: Changing curve mean weight/radius/tilt changes handle type
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
2024-10-16 18:28:07 +02:00
Falk David
783f69343a Cleanup: Remove unused variable 2024-10-16 18:09:33 +02:00
Bastien Montagne
a153809829 Fix #128704: Make liboverride keeps linked object in 'main' Scene collection.
Scene itself (and therefore its main collection) was not remapped from
linked objects to the newly created liboverrid ones.
2024-10-16 17:32:04 +02:00
Lukas Tönne
f10a2f6f7b Fix #129105: GPv3: Crash when sculpting on modified grease pencil data
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
2024-10-16 16:52:52 +02:00
Bastien Montagne
8250aa3692 Cleanup: Update comment in Outliner copy/paste code. 2024-10-16 16:45:55 +02:00
Bastien Montagne
9405bd25d6 Fix #128519: Pasting pose from liboverride armature creates warning.
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.
2024-10-16 16:45:55 +02:00
Bastien Montagne
631876e1e8 Fix (unreported) read code generating IDs runtime UID too early.
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.
2024-10-16 16:45:55 +02:00
Bastien Montagne
d8ad7fa39d Fix (unreported) error in 'make_local' code of the PartialWriteContext.
Found while investigating solution for #128519.

Also added comment about usage of the `MAKE_LOCAL` option itself.
2024-10-16 16:45:55 +02:00
Lukas Tönne
297b97f2df Fix #128769: GPv3: Interpolate tool takes selection into account
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
2024-10-16 16:41:06 +02:00
YimingWu
9cb4d3bbff Fix #128887: LineArt: Prevent iterating over not evaluated objects
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
2024-10-16 15:15:11 +02:00
Falk David
aea400466c Fix #129012: GPv3: Crash when increasing curve resolution
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
2024-10-16 14:40:27 +02:00
Pratik Borhade
7c9023ca41 Fix #129023: GPv3: Deselecting vgroup elements fails in stroke domain
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
2024-10-16 13:45:28 +02:00
Casey Bianco-Davis
b2cff223a1 Fix: #126515: Brush radius sensitivity not consisted at different zoom levels
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
2024-10-16 12:09:52 +02:00
Falk David
30adc33730 Fix #128827: GPv3: Bucket fill doesn't work on macOS
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
2024-10-16 10:29:07 +02:00
Pratik Borhade
ceea1a4d99 Fix #129024: GPv3: Renaming a vertex group removes group assignment
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
2024-10-16 10:27:09 +02:00
Christoph Lendenfeld
0753f7f78c Fix #128445: Symmetrize pose bone settings
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
2024-10-16 10:25:51 +02:00
Falk David
29b884903a Fix #128914: GPv3: Crash applying modifier to all frames
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
2024-10-16 10:22:58 +02:00
Christoph Lendenfeld
0211a68fb4 Fix #128805: Missing Depsgraph Update when removing FCurve modifiers
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
2024-10-16 09:29:45 +02:00
Christoph Lendenfeld
41a3e6c3bd Fix #125451: Duplicating bone doesn't copy pose bone colors
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
2024-10-16 09:26:48 +02:00
Campbell Barton
ccb92947c5 Fix #129067: Transforming an edit-mesh crashes with cage editing
Regression in [0] although prior to this the `deformed_only` was not
being set, caused by a separate regression.

[0]: 80fa49f24ae768c5869065363e116b51175fb2df
2024-10-16 16:57:06 +11:00
Sean Kim
b8e5c66947 Fix #129069: Drag Dot and Anchored paint brush modes don't clear mesh
Introduced in d282b1735e

The two stroke types need to have the mix_colors StrokeCache variable
reset in between daubs to prevent extra data from accumulating when
applying colors.

Pull Request: https://projects.blender.org/blender/blender/pulls/129084
2024-10-16 07:04:08 +02:00
Campbell Barton
7ae7592899 Fix #128346: Search results fail to display in the outliner
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
2024-10-16 14:05:23 +11:00
Sybren A. Stüvel
399c2148c3 Cleanup: run make format
No functional changes.
2024-10-15 15:12:42 -07:00
Jesse Yurkovich
81f439ff37 Fix #128916: Tag Light ID when applying scale
When applying scale on a light in the viewport, ensure we tag the light
itself for updating. Otherwise, the viewport get confused over which
size to use.

Pull Request: https://projects.blender.org/blender/blender/pulls/129030
2024-10-15 20:24:32 +02:00
YimingWu
1e2e90e2d4 Fix #129051: GPv3: Write default u_scale in draw tool
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
2024-10-15 16:39:17 +02:00
Thomas Lachmann
5f84f934a8 Fix #127087: GPv3: Initialize/copy attributes when adding/duplicating layers
- set default values for attributes on new GP layer
- copy attributes when duplicating GP layer

Pull Request: https://projects.blender.org/blender/blender/pulls/128344
2024-10-15 15:08:09 +02:00
sean-murray
5be60642ad Fix: GPv3: Crash when using build modifier with cyclic curves
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
2024-10-15 14:17:05 +02:00
Falk David
715a37b662 Fix #129049: Solid mode doesn't render strokes correctly
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
2024-10-15 13:47:24 +02:00
Jeroen Bakker
6f6efb6ec0 Vulkan: Disable Intel 10th gen and lower on Windows
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
2024-10-15 13:44:05 +02:00
Jeroen Bakker
cdef54a5ce Vulkan: Workaround for unused attachment extension
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
2024-10-15 13:43:21 +02:00
Jacques Lucke
5ad56c52ff Fix #128861: crash with Index Switch node when sliced virtual arrays are used
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
2024-10-15 11:02:22 +02:00
Campbell Barton
44d0452a78 Cleanup: spelling in comments 2024-10-15 12:51:05 +11:00
Jesse Yurkovich
9c36cfb4b8 Fix: Use error reports as indication of cancellation for some IO ops
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
2024-10-14 22:55:20 +02:00
Sean Kim
feaa7bbbcc Fix #129013: Certain brushes can cause artifacts
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
2024-10-14 22:46:30 +02:00
Sean Kim
3d40d6e188 Fix #128999: Smooth Surface brush doesn't update viewport
Missed in 347ec1acd7

Pull Request: https://projects.blender.org/blender/blender/pulls/129017
2024-10-14 21:45:12 +02:00
Philipp Oeser
0319b7b50a Fix #127611: Linked material can be modified by Copy/Paste Material
Seems like we can use `object_materials_supported_poll` (similar to
other material operators) that already checks the right things.

Pull Request: https://projects.blender.org/blender/blender/pulls/128996
2024-10-14 17:59:59 +02:00
Sean Kim
b2e0193cc1 Fix #128929: Multires face set automasking doesnt work with no face set
Introduced in 7c42c80126

Incorrect value of `1` was used for the situation where the
`.sculpt_face_set` attribute was missing on the mesh instead of
`SCULPT_FACE_SET_NONE`.

Pull Request: https://projects.blender.org/blender/blender/pulls/128939
2024-10-14 17:27:45 +02:00
Sean Kim
a205e34158 Fix #128933: Dyntopo density brush prints constant console errors
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
2024-10-14 17:23:10 +02:00
Julian Eisel
10f2d683ba Cleanup: Use dedicated string reference type for drop tooltip drawing
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.
2024-10-14 16:41:54 +02:00
Guillermo Venegas
682161283e Fix unreported: FileHandler drag-an-drop tooltip is generated in a wrong context
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
2024-10-14 16:39:31 +02:00
Jeroen Bakker
ceb61ac921 Fix: Vulkan: Strict extension test
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
2024-10-14 15:43:41 +02:00
Jeroen Bakker
d35cd15e12 Fix #128608: Vulkan: Sync issues when sharing context between threads
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
2024-10-14 15:42:46 +02:00
Jeroen Bakker
fb862d082a Fix: Vulkan: Sync issue command buffers
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
2024-10-14 15:41:30 +02:00
Jeroen Bakker
3b7dd61e01 Fix: Vulkan: Incorrect Host Visibility Allocation
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
2024-10-14 15:39:27 +02:00
Jeroen Bakker
acb205763e Fix: Vulkan: Cycles CPU Synchronization
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
2024-10-14 15:38:22 +02:00
Jeroen Bakker
af151e89a7 Fix: Vulkan: Unguarded Access Device Queues
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
2024-10-14 15:30:11 +02:00
Jacques Lucke
2806d54320 Fix #128499: dot dash modifier crashes because of missing attributes
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
2024-10-14 14:19:24 +02:00
Pratik Borhade
373d77aeb6 Fix #128672: Brush Assets: Wrong catalogs in asset shelf by default
Mistake in `catalog_path` name

Pull Request: https://projects.blender.org/blender/blender/pulls/128681
2024-10-14 14:10:21 +02:00
Bastien Montagne
39c1127dc0 Fixes for #128078
# 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
2024-10-14 13:59:06 +02:00
Pratik Borhade
ae1409b9ae Fix #128921: GPv3: Influence subpanel is missing in Simplify modifier
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
2024-10-14 13:06:07 +02:00