From 5257f3e770773c69e34789ac7f17d956c9980b2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A3=8E=E9=9D=92=E5=B1=B1?= Date: Thu, 6 Mar 2025 21:01:37 +0800 Subject: [PATCH] Fix forcing `ViewportTexture` after selecting a viewport in the "Pick a Viewport" popup This popup only pops up when a `ViewportTexture` (or its derived class) object is **just** assigned. --- editor/editor_properties.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp index 935915a0c080..3a813c091e38 100644 --- a/editor/editor_properties.cpp +++ b/editor/editor_properties.cpp @@ -3228,8 +3228,9 @@ void EditorPropertyResource::_viewport_selected(const NodePath &p_path) { return; } - Ref vt; - vt.instantiate(); + Ref vt = get_edited_property_value(); + ERR_FAIL_COND(vt.is_null()); + vt->set_viewport_path_in_scene(get_tree()->get_edited_scene_root()->get_path_to(to_node)); emit_changed(get_edited_property(), vt);