diff --git a/Scripts/Global.gd b/Scripts/Global.gd index 046d81531..19674c266 100644 --- a/Scripts/Global.gd +++ b/Scripts/Global.gd @@ -16,6 +16,7 @@ var saved := true # Checks if the user has saved # Canvas related stuff var canvases := [] setget canvases_changed var layers := [] setget layers_changed +var layers_changed_skip := false var current_frame := 0 setget frame_changed var current_layer := 0 setget layer_changed # warning-ignore:unused_class_variable @@ -500,6 +501,9 @@ func canvases_changed(value : Array) -> void: func layers_changed(value : Array) -> void: layers = value + if layers_changed_skip: + layers_changed_skip = false + return for container in layers_container.get_children(): container.queue_free() diff --git a/Scripts/LayerContainer.gd b/Scripts/LayerContainer.gd index fb6a80518..dc8d93b8d 100644 --- a/Scripts/LayerContainer.gd +++ b/Scripts/LayerContainer.gd @@ -55,6 +55,7 @@ func save_layer_name(new_name : String) -> void: line_edit.visible = false line_edit.editable = false label.text = new_name + Global.layers_changed_skip = true Global.layers[i][0] = new_name func _on_VisibilityButton_pressed() -> void: