Fix: GPv3: "Only In Multiframe" overlay not working

There were some issues in the code that sets up the draw calls.
The `only_lines` option needs to consider multi frame editing.

Resolves #129873.

Pull Request: https://projects.blender.org/blender/blender/pulls/129944
This commit is contained in:
Pratik Borhade
2024-11-12 14:44:31 +01:00
committed by Falk David
parent a0cfb0b142
commit 22d94df4cf

View File

@@ -507,7 +507,8 @@ static GPENCIL_tObject *grease_pencil_object_cache_populate(GPENCIL_PrivateData
OB_MODE_PAINT_GREASE_PENCIL,
OB_MODE_WEIGHT_GREASE_PENCIL,
OB_MODE_VERTEX_GREASE_PENCIL) &&
info.frame_number != pd->cfra && pd->use_multiedit_lines_only;
info.frame_number != pd->cfra && pd->use_multiedit_lines_only &&
do_multi_frame;
const bool is_onion = info.onion_id != 0;
visible_strokes.foreach_index([&](const int stroke_i, const int pos) {
@@ -526,7 +527,7 @@ static GPENCIL_tObject *grease_pencil_object_cache_populate(GPENCIL_PrivateData
const bool hide_onion = is_onion && ((gp_style->flag & GP_MATERIAL_HIDE_ONIONSKIN) != 0 ||
(!do_onion && !do_multi_frame));
const bool skip_stroke = hide_material || (!show_stroke && !show_fill) ||
(only_lines && !is_onion) || hide_onion;
(only_lines && !do_onion && is_onion) || hide_onion;
if (skip_stroke) {
t_offset += num_triangles_per_stroke[pos];