From 8cb0b60fb82bcb07e4dc8f698ce174b0a18caceb Mon Sep 17 00:00:00 2001 From: Calvin Chu Date: Fri, 31 May 2024 18:18:29 +1000 Subject: [PATCH] Moved effect nodes instantiation to _ready _enter_tree can be called more than once. Duplicate instantiations do not have the correct names causing the Undefined type Post Processing addon error --- addons/post_processing/node/post_process.gd | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/addons/post_processing/node/post_process.gd b/addons/post_processing/node/post_process.gd index 05d97b3..085b6a7 100644 --- a/addons/post_processing/node/post_process.gd +++ b/addons/post_processing/node/post_process.gd @@ -137,8 +137,7 @@ func _check_shader_visibility(_name: String) -> bool: push_error("#Undefined type Post Processing addon - verify it has been properly integrated.") return false # bad! -func _enter_tree(): - +func _ready(): _add_canvas_layer_children("res://addons/post_processing/node/children/ChromaticAberration.tscn", "CA") _add_canvas_layer_children("res://addons/post_processing/node/children/blur.tscn", "BL") _add_canvas_layer_children("res://addons/post_processing/node/children/fish_eye.tscn", "FEYE") @@ -155,7 +154,10 @@ func _enter_tree(): _add_canvas_layer_children("res://addons/post_processing/node/children/color_correction.tscn", "CC") _add_canvas_layer_children("res://addons/post_processing/node/children/pixelate.tscn", "PXL") _add_canvas_layer_children("res://addons/post_processing/node/children/palette.tscn", "PLT") - + + update_shaders() + +func _enter_tree(): update_shaders() func _add_canvas_layer_children(_path : String, _name: String) -> void: