Commit Graph

117289 Commits

Author SHA1 Message Date
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
e08b91f6be Merge branch 'blender-v4.3-release' 2024-10-16 16:46:53 +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
Sergey Sharybin
06c0bd6699 Merge branch 'blender-v4.3-release' 2024-10-16 16:29:24 +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
ee0fd0ed19 Merge branch 'blender-v4.3-release' 2024-10-16 17:23:33 +05:30
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
Clément Foucault
6c9db47e53 Cleanup: Overlay-Next: Add missing includes and simplify prepass logic 2024-10-16 12:37:46 +02:00
Clément Foucault
aa8f2c0e3d Fix: Overlay-Next: Grid is occluded by scene geometry in wireframe mode
It was still using the depth buffer from Workbench.

Use the dummy texture and point sampling to avoid
more invasive changes.
2024-10-16 12:37:46 +02:00
Clément Foucault
cc1c952692 Fix: Overlay-Next: UV face overlay not visible
Was caused by grid being drawn in front of the
overlays.
2024-10-16 12:37:46 +02:00
Clément Foucault
1d264b4589 Overlay-Next: Avoid undefined memory as object handle
Fixes selection
2024-10-16 12:37:46 +02:00
Campbell Barton
5a561c6aeb Cleanup: spelling in comments 2024-10-16 21:10:49 +11: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
Campbell Barton
2dc1734485 Cleanup: remove unused argument 2024-10-16 21:09:36 +11:00
Campbell Barton
10960b99c9 Merge branch 'blender-v4.3-release' 2024-10-16 21:08:15 +11:00
Campbell Barton
363b2f31b6 Merge branch 'blender-v4.3-release' 2024-10-16 21:08:12 +11:00
Campbell Barton
c4fa40a37d Merge branch 'blender-v4.3-release' 2024-10-16 21:08:10 +11:00
Campbell Barton
0d138ec986 Merge branch 'blender-v4.3-release' 2024-10-16 21:08:07 +11:00
Campbell Barton
8a5cc85bcd Merge branch 'blender-v4.3-release' 2024-10-16 21:08:04 +11:00
Campbell Barton
cbce9fb26b Merge branch 'blender-v4.3-release' 2024-10-16 21:08:02 +11:00
Omar Emara
02ff72deb8 Cleanup: Reduce nesting in get_input_texture 2024-10-16 12:20:44 +03:00
Casey Bianco-Davis
c13cde24cc 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 11:17:26 +02:00
Aras Pranckevicius
13e5420c91 UI: Better order of ffmpeg container/codec dropdown entries
Put modern/main containers (mp4, mkv, webm) and codecs (av1, h264, vp9) before
others, then a separator, and then alphabetically sorted "the rest"
(which are either ancient, or somewhat niche options).

Comparison images in the PR.

Pull Request: https://projects.blender.org/blender/blender/pulls/118412
2024-10-16 10:45:16 +02:00
Aras Pranckevicius
6a1301f4c7 Refactor: factor out ffmpeg CRF/rate setting into one function
Previously the code was scattered around in places and the logic
was hard to follow. CRF values will need more remapping done on them
for future codecs and/or 10/12 bit video support, so move all that logic
into set_quality_rate_options function that does three clear things:
1) set constant bit rate if that is used,
2) set lossless mode if that is used,
3) set CRF parameters if that is used.

Pull Request: https://projects.blender.org/blender/blender/pulls/129092
2024-10-16 10:43:55 +02:00
Clément Foucault
8a2acc731d EEVEE: Avoid automatic printf injection in debug build
Fixes a crash in debug build when closing blender.
2024-10-16 10:30:35 +02:00
Clément Foucault
c91baf1cdd GPU: GLSL Preprocess: Avoid parsing includes as string
Remove them before string parsing
2024-10-16 10:30:35 +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
Clément Foucault
7f03a305eb EEVEE: Avoid printf injection in debug build
This avoid a crash in debug build caused by the printf
feature to be not so stable.
2024-10-16 09:50:55 +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
Clément Foucault
4ba944b15a GPU: GLSL Preprocess: Always remove quotes
We cannot do this for the MSL files. Also
they are written in MSL which should not be
processed. So use datatoc for them.

Also add quote linting for GLSL files.
2024-10-16 09:08:51 +02:00
Clément Foucault
7110890b09 GPU: GLSL preprocessor: Only do function parsing on library files 2024-10-16 09:08:51 +02:00
Campbell Barton
11dfa3297e Merge branch 'blender-v4.3-release' 2024-10-16 17:02:56 +11: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
Campbell Barton
2aee3331f1 Cleanup: reduce the scope of startx/y variables in outliner drawing
Simplify outliner_draw_tree by clarifying when these values are reset
as it wasn't obvious when the previously calculated values weren't
reused.
2024-10-16 16:29:50 +11:00
Campbell Barton
ee9f16227b Cleanup: pass TreeViewContext by const reference
Use a reference as this is never null.
2024-10-16 16:12:43 +11:00
Campbell Barton
948c9921a5 Cleanup: context arguments for outliner drawing
- Add TreeViewContext::layer_collection.
- Remove the context argument for outliner drawing,
  use TreeViewContext instead.
- Pass the TreeViewContext to outliner_sync_selection instead of
  initializing again from the context.
2024-10-16 16:12:43 +11:00
Sean Kim
e6d684a357 Merge branch 'blender-v4.3-release' 2024-10-15 22:06:10 -07: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
93c984283e Cleanup: quiet compiler warnings 2024-10-16 15:07:13 +11:00
Aras Pranckevicius
db4d8d1046 Fix: Video CRF being reset when switching to AV1 codec
Two issues were present in code that was resetting CRF quality level
to "do not use CRF, use bitrate settings" mode:

- It did not include AV1 codec, so whenever you switched to AV1 the CRF
  was changing to constant bitrate.
- It wrongly included DNxHD codec. That seemed like it was trying to
  fix #100079 in 06a01168f6, but it was doing exactly the opposite
  of what a fix should have been? I don't understand it :/ In any case,
  now with DNxHD removed the CRF properly switches to constant bitrate
  when changing codec to DNxHD.

Factored the actual logic into BKE_ffmpeg_codec_supports_crf function.

Pull Request: https://projects.blender.org/blender/blender/pulls/129050
2024-10-16 05:48:51 +02:00
Campbell Barton
71198d4f8f Merge branch 'blender-v4.3-release' 2024-10-16 14:07:22 +11:00