Commit Graph

113836 Commits

Author SHA1 Message Date
Pratik Borhade
74129b648b Fix #129142: GPv3: gesture select tools selecting only right handles
When selection type is set/and for gesture selection tools, Instead of
current attribute, all three selection attributes (`.selection`, `left_handle`,
`right_handle`) are reset in every iteration of for loop.

Pull Request: https://projects.blender.org/blender/blender/pulls/129147
2024-10-18 15:32:53 +02:00
Charles S
49bfcbc06d Fix: Replace MEM_freeN / MEM_delete mismatch in blurkernel
Discovered via an abort when using the blur brush.

Pull Request: https://projects.blender.org/blender/blender/pulls/128956
2024-10-18 15:20:32 +02:00
Julian Eisel
c8e75c03c3 Grease Pencil: Enable available catalogs by default in asset shelf
In grease pencil draw mode, enable the Draw, Erase and Utilities
catalogs by default for the asset shelf, meaning they will show up as
tabs in the shelf. For grease pencil sculpt mode it's the Contrast,
Transform and Utilities mode (consistent with mesh sculpt mode).

This makes the assets of the corresponding types easily available, even
without requiring the "Filter Brushes by Tool" asset shelf option
enabled. It also makes the catalogs and the contained brushes more
discoverable as an organization helper.

These catalogs were added in 09bd5a5777.
2024-10-18 14:42:51 +02:00
Julian Eisel
3a708a27f9 Sculpt/Paint: Disable asset shelf filtering by tool by default
Disables the "Filter Brushes by Tool" toggle of the brush asset shelf
options by default.

After further feedback, we want to keep this option disabled by default.
It's useful to be able to access all brushes from the asset shelf,
regardless of what the active tool is. In many cases you'd see the asset
shelf with only one brush, which wastes space and isn't a good look
design quality wise. The following commit will also enable some more
asset catalogs by default which should be useful for filtering brushes,
and reduce the need for filtering by active tool.

So all things considered, while having this option is useful, it can
remain disabled by default.
2024-10-18 14:16:58 +02:00
Jacques Lucke
30c3d17bb6 Fix #129190: invalid runtime data in lineart modifier after load 2024-10-18 12:38:00 +02:00
Falk David
078f16a8d5 Fix: GPv3: Interpolation not working with no selection
The interpolation tool in edit mode would create an empty keyframe if nothing in the
`from_drawing` and `to_drawing` was selected. This is not how the tool behaved in GPv2
so this is unexpected.

The fix  checks that if `only_selected` is used, there also is a selection in both of the
drawings in the pair, and otherwise fallback to interpolating all the strokes.
This is consistent with how the tool worked in 4.2.

Pull Request: https://projects.blender.org/blender/blender/pulls/129206
2024-10-18 11:38:46 +02:00
John Kiril Swenson
d5d81c5078 VSE: Switch to box select default for timeline
PR #128051 made some improvements to code by cleaning up properties and
simplifying logic.

However, the default tool in most spaces is box select. By switching to
box select default, there should be more front-facing consistency across
spaces while still retaining near-identical behavior.

This patch would fix the small bug listed in #128671 while keeping the
simplified code benefits from #128051.

Also:
- Move selection keymap items up in the Sequencer (Global) keymap so it
  is more visible (similar to Node Editor ordering).
- Split `side_of_frame` property for ctrl press keymap item into a
  separate keymap item on ctrl click for both LCS and RCS to avoid
  clashing with ctrl+drag for box selects in RCS.

Pull Request: https://projects.blender.org/blender/blender/pulls/129028
2024-10-18 05:50:09 +02:00
Harley Acheson
cf2d3d0867 Fix: Docking Called from Shortcut Without Status Bar
When starting a docking operation from an assigned shortcut, the source
area will be incorrect if the Status Bar is not currently being shown.
This PR just adds defaults that are never valid window coordinates.

Pull Request: https://projects.blender.org/blender/blender/pulls/129187
2024-10-18 04:28:33 +02:00
Arye Ramaty
116a55e46e Fix #128997: wrong evaluation of outputs in the Index of Nearest node
Pull Request: https://projects.blender.org/blender/blender/pulls/128998
2024-10-17 23:47:13 +02:00
Sean Kim
e01713be7c Fix #129135: Automasking topology doesn't work with certain brushes
Introduced in 915be63b01

Also fixes an unreported similar issue with BMesh

Pull Request: https://projects.blender.org/blender/blender/pulls/129139
2024-10-17 23:12:20 +02:00
Falk David
0a560582b5 Fix: GPv3: Python: Missing parent_group property on layer groups
This property was available for `layers` but was missed for layer groups.
Adds a `parent_group` property for layer groups that returns the
parent group if the group is inside another group.
For groups that are inside the root, returns `None`.

Pull Request: https://projects.blender.org/blender/blender/pulls/129168
2024-10-17 18:34:19 +02:00
Jacques Lucke
ca2058ab04 Fix #129128: broken data-block search for short names
If ifdef for `WITH_ANIM_BAKLAVA` accidentally removed the `else { ... }` branch
around `name = RNA_struct_name_get_alloc(...)`. For data-block names,
`BKE_id_full_name_ui_prefix_get` is used above which adds 3 extra letters before
the data-block name. This are removed again by the bug. Later code removes them
again leaving potentially an empty string.

Pull Request: https://projects.blender.org/blender/blender/pulls/129153
2024-10-17 16:59:35 +02:00
Falk David
c539ea792c Fix: GPv3: Reduce draw tool performance regression
During the painting operation, the `GreasePencilDrawing` is updated in-place.
Previously, we simply tagged the whole drawing for a topology update.
This meant that the triangulation and curve normals were recomputed
for (pretty much) every new input sample.

Since the draw tool only creates one new stroke, we can copy the
triangulation of all the other strokes and only recompute the triangulation
of the newly drawn stroke(s).

First, a new `triangle_offsets_cache` is added that is lazily computed.
The computation for this should be pretty cheap.
Then, a new function `Drawing::tag_topology_changed(const IndexMask &curves_to_update)`
is added. This function takes an index mask of curves and only updates
their triangle cache. The cache for the other curves is copied.

In a test file with around 400k points, recomputing the triangle cache
(every input sample) took around 45ms. This meant that there was a noticable
drop in frame rate. With this patch, the time for each sample goes down to
less than 0.1ms. The frame rate feels much better.

But, drawing a longer and longer stroke still makes this time go up,
because the triangulation for the single stroke becomes more and
more expensive. This will have to be improved further.

Part of #124149.

Pull Request: https://projects.blender.org/blender/blender/pulls/129115
2024-10-17 15:28:44 +02:00
Philipp Oeser
3c5103d9c9 Fix #129148: Weight/Vertex paint not switching to Blur with Shift
In both `essentials_brushes-mesh_vertex.blend` and `essentials_brushes-
mesh_weight.blend`, the brush is actually only called "Blur".

Pull Request: https://projects.blender.org/blender/blender/pulls/129158
2024-10-17 14:55:15 +02:00
Philipp Oeser
58248c34cb Fix: Linked/liboverride objects can get their materials assignments modified by drag and drop
Changes would be lost (or worse things can happen, see below), so this
is now prevented by polishing the polls for these operations.

Behavior of Materials in override objects was considered shaky as well (lost
on reload, no undo or crash on undo, see  #127605, #127606, #101552 in
general) , so conclusion was to prevent this on linked as well as liboverride
objects.

Pull Request: https://projects.blender.org/blender/blender/pulls/129064
2024-10-17 14:54:45 +02:00
Julian Eisel
5e5c387159 Fix: Another typo in brush asset deletion confirmation message 2024-10-17 14:44:17 +02:00
Julian Eisel
41b8ee1c48 Sculpt/Paint: Change label of asset update operator in menu for clarity
From feedback: "Update Asset" sounds more like receiving a new version
of the brush, while this actually saves the changed brush to the asset
library. "Save Changes to Asset" is more clear and fits well with the
labels of other menu items in the menu.
2024-10-17 14:36:05 +02:00
Julian Eisel
7decebe2c3 Fix: Typo in brush asset deletion confirmation message
Also use "cannot" instead of "can't", since that's less likely to be
misread. This is also noted in the human interface guidelines:
https://developer.blender.org/docs/features/interface/human_interface_guidelines/writing_style/
2024-10-17 14:20:07 +02:00
Lukas Tönne
d2210df6af Fix: GPv3: Interpolate tool uses selection in paint mode
Follow-up fix for #128769.

Selection is now taken into account for interpolation tool, but should
be ignored in paint mode.

Pull Request: https://projects.blender.org/blender/blender/pulls/129150
2024-10-17 14:09:48 +02:00
Jacques Lucke
a80bb83bff Fix: memory leak with muted group nodes in localized shader node trees
The leak happens when there is a muted group node in a shader node tree which is
rendered. For rendering, the drawing code "localizes" the node tree which also
means duplicating the node groups used by each group node (might even duplicate
the same group more than once if it's used by multiple nodes). Generally, this
works fine, because all of these duplicates are freed when the tree is
flattened.

However, there is a preprocessing step which deletes all muted nodes from the
tree. This code path did not free the groups recursively.

Pull Request: https://projects.blender.org/blender/blender/pulls/129124
2024-10-17 13:48:28 +02:00
Jacques Lucke
1564e02a8f Fix #128994: crash when extracting point meshes
The domain interpolation can fail when e.g. converting from an
empty to a non-empty domain.
2024-10-17 13:15:54 +02:00
Julian Eisel
36877ce6d9 Fix: Essentials asset library loaded from wrong location if present
Design of the essentials asset library is to treat it as part of
Blender (as if it were compiled into the binary), so the location and
state of these assets is clear and can be assumed in code. User edits
are not expected.

Because of that we should only look for this asset library in the
installation ("system") location, not in the user configuration which
would take priority if present. On some devs machines this location
would actually be present, making the essentials unavailable and causing
confusing/misleading warning prints, see #128420.
2024-10-17 12:16:56 +02:00
Christoph Lendenfeld
328ec2b172 Fix #123963: Unable to select through unselectable bones
When trying to select bones that are inside other bones which are not selectable,
the selection would fail. This is inconsistent with object mode, where unselectable
things are just ignored.
This patch fixes it for pose mode and edit mode.
Note that there are two areas for edit mode that were modified.
The one in `ed_armature_pick_bone_from_selectbuffer/202` is never actually reached,
but I added the code there for completeness.

The code in `get_nearest_editbonepoint` had to be modified some more to
implement a similar logic as `armature_select.cc/220`

Pull Request: https://projects.blender.org/blender/blender/pulls/129120
2024-10-17 12:13:35 +02:00
Falk David
40e1bf214a Fix: GPv3: Don't create handle types attribute for all curve types
The "Set Handle Type" operator didn't check the curve types
(not if the curves are editable for that matter).

This fix retrieves the edtiable bézier curves and only changes
the handle types of those.
2024-10-17 11:35:13 +02:00
Campbell Barton
3290e33d34 Cleanup: spelling in comments 2024-10-17 11:53:47 +11:00
Campbell Barton
8752413171 Fix null pointer de-reference in rna_Particle_Material_itemf
Correct error in [0], also break out of the loop once the
object is found.

[0]: 140c0f1db9
2024-10-17 11:53:46 +11:00
notrudyyy
450aad7489 Cleanup: Fix Erase Displacement typos
Fixes multiple typos in the Erase Displacement option of the Mesh Filter tool.

Pull Request: https://projects.blender.org/blender/blender/pulls/128745
2024-10-16 19:01:24 +02:00
Philipp Oeser
140c0f1db9 Fix #129066: ParticleSettings.material_slot wrong from python
`rna_Particle_Material_itemf` was using the context object for getting
the materials.
This is OK when doing it through the UI (the context object is correct
in the Properties Editor, also when pinned), but might not be correct
when doing this from python.

So now do similar as in `rna_Particle_change_type`, iterate all objects
to find the one matching the `ParticleSettings` (but only do this if the
context object does not have a matching `ParticleSettings` already).

NOTE: `rna_Particle_change_type` could be sped up as well with this
method (checking context object first), might be for a separate PR.

Pull Request: https://projects.blender.org/blender/blender/pulls/129101
2024-10-16 18:29:08 +02:00
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