Fix #131239: Grease Pencil: Last stroke in drawing uses wrong layer opacity

Flush was being done on the wrong pass. It was also creating errors.
This commit is contained in:
Clément Foucault
2024-12-02 13:21:04 +01:00
parent e3625410e3
commit eb6de2d4fc

View File

@@ -483,13 +483,15 @@ static GPENCIL_tObject *grease_pencil_object_cache_populate(
continue;
}
if (last_pass) {
drawcall_flush(*last_pass);
}
GPENCIL_tLayer *tgp_layer = grease_pencil_layer_cache_add(
pd, ob, layer, info.onion_id, is_layer_used_as_mask, tgp_ob);
PassSimple &pass = *tgp_layer->geom_ps;
last_pass = &pass;
drawcall_flush(pass);
const bool use_lights = pd->use_lighting &&
((layer.base.flag & GP_LAYER_TREE_NODE_USE_LIGHTS) != 0) &&
(ob->dtx & OB_USE_GPENCIL_LIGHTS);