From 9c170ee5a02984537780766c23f4038e3875afb1 Mon Sep 17 00:00:00 2001 From: Emmanouil Papadeas <35376950+OverloadedOrama@users.noreply.github.com> Date: Sun, 11 Aug 2024 01:38:18 +0300 Subject: [PATCH] Fix group layer children blending not working with nested group layers and with layer effects --- src/Autoload/Export.gd | 2 +- src/Classes/Layers/GroupLayer.gd | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Autoload/Export.gd b/src/Autoload/Export.gd index 2e8ce4b20..10a6bfadc 100644 --- a/src/Autoload/Export.gd +++ b/src/Autoload/Export.gd @@ -699,7 +699,7 @@ func _blend_layers( if layer is GroupLayer: layer_image.copy_from(layer.blend_children(frame, Vector2i.ZERO)) else: - layer_image.copy_from(frame.cels[export_layers - 2].get_image()) + layer_image.copy_from(layer.display_effects(frame.cels[export_layers - 2])) image.blend_rect(layer_image, Rect2i(Vector2i.ZERO, project.size), origin) diff --git a/src/Classes/Layers/GroupLayer.gd b/src/Classes/Layers/GroupLayer.gd index f6cb4f40f..f073dd3f5 100644 --- a/src/Classes/Layers/GroupLayer.gd +++ b/src/Classes/Layers/GroupLayer.gd @@ -23,18 +23,19 @@ func blend_children(frame: Frame, origin := Vector2i.ZERO) -> Image: var layer := children[i] if not layer.is_visible_in_hierarchy(): continue + var cel := frame.cels[layer.index] if layer is GroupLayer: var blended_children: Image = layer.blend_children(frame, origin) if DisplayServer.get_name() == "headless": image.blend_rect(blended_children, blend_rect, origin) else: textures.append(blended_children) + DrawingAlgos.set_layer_metadata_image(layer, cel, metadata_image, i) else: - var cel := frame.cels[layer.index] if DisplayServer.get_name() == "headless": DrawingAlgos.blend_layers_headless(image, project, layer, cel, origin) else: - textures.append(display_effects(cel)) + textures.append(layer.display_effects(cel)) DrawingAlgos.set_layer_metadata_image(layer, cel, metadata_image, i) if DisplayServer.get_name() != "headless":