1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-01-18 17:19:50 +00:00
This commit is contained in:
Variable 2025-01-05 14:25:13 +05:00 committed by GitHub
commit d4da5a6a02
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -141,6 +141,8 @@ func add_animation(indices: Array, destination: int, from_tag: AnimationTag = nu
l = GroupLayer.new(project) l = GroupLayer.new(project)
Global.LayerTypes.THREE_D: Global.LayerTypes.THREE_D:
l = Layer3D.new(project) l = Layer3D.new(project)
if l == null: # Ignore copying this layer if it isn't supported
continue
var cels := [] var cels := []
for f in project.frames: for f in project.frames:
cels.append(l.new_empty_cel()) 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 # add more types here if they have a copy_content() method
if src_cel is PixelCel: if src_cel is PixelCel:
var src_img = src_cel.copy_content() var src_img: ImageExtended = src_cel.copy_content()
var copy := project.new_empty_image() var copy: ImageExtended = new_cel.create_empty_content()
copy.blit_rect( copy.blit_rect(
src_img, Rect2(Vector2.ZERO, src_img.get_size()), Vector2.ZERO src_img, Rect2(Vector2.ZERO, src_img.get_size()), Vector2.ZERO
) )