mirror of
https://projects.blender.org/blender/blender.git
synced 2025-01-22 07:22:12 -05:00
Fix #132113: Grease Pencil: Sort cache before draw_scene
early return
`GPENCIL_draw_scene` uses `pd->tobjects.first == nullptr` to determine whether to early return (draw nothing). When there's only "In Front" grease pencil objects in scene, `tobjects.first` can be `nullptr` but `tobjects_infront.first` is valid, in which case no grease pencil would be drawn. Becase `gpencil_object_cache_sort` will link those two command lists both to `tobjects` and allow `infront` ones to draw after others, thus move it before the early return to allow drawing to proceed normally. Pull Request: https://projects.blender.org/blender/blender/pulls/132155
This commit is contained in:
parent
d1e3db71a6
commit
932fa1b8bf
1 changed files with 3 additions and 3 deletions
|
@ -892,6 +892,9 @@ void GPENCIL_draw_scene(void *ved)
|
|||
mul_v4_fl(clear_cols[1], pd->fade_3d_object_opacity);
|
||||
}
|
||||
|
||||
/* Sort object by decreasing Z to avoid most of alpha ordering issues. */
|
||||
gpencil_object_cache_sort(pd);
|
||||
|
||||
if (pd->tobjects.first == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
@ -911,9 +914,6 @@ void GPENCIL_draw_scene(void *ved)
|
|||
|
||||
blender::draw::View &view = blender::draw::View::default_get();
|
||||
|
||||
/* Sort object by decreasing Z to avoid most of alpha ordering issues. */
|
||||
gpencil_object_cache_sort(pd);
|
||||
|
||||
LISTBASE_FOREACH (GPENCIL_tObject *, ob, &pd->tobjects) {
|
||||
GPENCIL_draw_object(vedata, view, ob);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue