diff --git a/src/Autoload/DrawingAlgos.gd b/src/Autoload/DrawingAlgos.gd index d6f05cf07..6cdc596df 100644 --- a/src/Autoload/DrawingAlgos.gd +++ b/src/Autoload/DrawingAlgos.gd @@ -22,7 +22,8 @@ func blend_layers( frame: Frame, origin := Vector2i.ZERO, project := Global.current_project, - only_selected := false + only_selected_cels := false, + only_selected_layers := false, ) -> void: var textures: Array[Image] = [] # Nx3 texture, where N is the number of layers and the first row are the blend modes, @@ -35,10 +36,18 @@ func blend_layers( var ordered_index := project.ordered_layers[i] var layer := project.layers[ordered_index] var include := true if layer.is_visible_in_hierarchy() else false - if only_selected and include: + if only_selected_cels and include: var test_array := [frame_index, i] if not test_array in project.selected_cels: include = false + if only_selected_layers and include: + var layer_is_selected := false + for selected_cel in project.selected_cels: + if i == selected_cel[1]: + layer_is_selected = true + break + if not layer_is_selected: + include = false var cel := frame.cels[ordered_index] var cel_image := layer.display_effects(cel) textures.append(cel_image) diff --git a/src/Autoload/Export.gd b/src/Autoload/Export.gd index de4e45fd4..b6766d380 100644 --- a/src/Autoload/Export.gd +++ b/src/Autoload/Export.gd @@ -182,7 +182,7 @@ func _calculate_frames(project := Global.current_project) -> Array[Frame]: if frame_current_tag > 1: # Specific tag var frame_start: int = project.animation_tags[frame_current_tag - 2].from var frame_end: int = project.animation_tags[frame_current_tag - 2].to - frames = project.frames.slice(frame_start - 1, frame_end - 1, 1, true) + frames = project.frames.slice(frame_start - 1, frame_end, 1, true) elif frame_current_tag == 1: # Selected frames for cel in project.selected_cels: frames.append(project.frames[cel[0]]) @@ -570,7 +570,7 @@ func _blend_layers( if export_layers == 0: DrawingAlgos.blend_layers(image, frame, origin, project) elif export_layers == 1: - DrawingAlgos.blend_layers(image, frame, origin, project, true) + DrawingAlgos.blend_layers(image, frame, origin, project, false, true) else: var layer := project.layers[export_layers - 2] var layer_image := Image.new() diff --git a/src/Autoload/OpenSave.gd b/src/Autoload/OpenSave.gd index fccf3da96..6472632c1 100644 --- a/src/Autoload/OpenSave.gd +++ b/src/Autoload/OpenSave.gd @@ -298,7 +298,7 @@ func open_v0_pxo_file(path: String, empty_project: bool) -> Project: var test_json_conv := JSON.new() var error := test_json_conv.parse(first_line) if error != OK: - print("Error, corrupt pxo file. Error code %s (%s)" % [error, error_string(error)]) + print("Error, corrupt legacy pxo file. Error code %s (%s)" % [error, error_string(error)]) file.close() return null