From 36bd0b9fe585ebe7643f643882c5d7f5106ab382 Mon Sep 17 00:00:00 2001 From: Variable Date: Sat, 4 Jan 2025 11:35:18 +0500 Subject: [PATCH] fix crash when importing (not-yet) supported layers from one project to the other --- src/UI/Dialogs/ImportTagDialog.gd | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/UI/Dialogs/ImportTagDialog.gd b/src/UI/Dialogs/ImportTagDialog.gd index dcb2cccf7..ec8a01471 100644 --- a/src/UI/Dialogs/ImportTagDialog.gd +++ b/src/UI/Dialogs/ImportTagDialog.gd @@ -141,6 +141,8 @@ func add_animation(indices: Array, destination: int, from_tag: AnimationTag = nu l = GroupLayer.new(project) Global.LayerTypes.THREE_D: l = Layer3D.new(project) + if l == null: # Ignore copying this layer if it isn't supported + continue var cels := [] for f in project.frames: cels.append(l.new_empty_cel()) @@ -185,8 +187,8 @@ func add_animation(indices: Array, destination: int, from_tag: AnimationTag = nu # add more types here if they have a copy_content() method if src_cel is PixelCel: - var src_img = src_cel.copy_content() - var copy := project.new_empty_image() + var src_img: ImageExtended = src_cel.copy_content() + var copy: ImageExtended = new_cel.create_empty_content() copy.blit_rect( src_img, Rect2(Vector2.ZERO, src_img.get_size()), Vector2.ZERO )