فهرست منبع

Merge pull request #103692 from Rindbee/fix-forcing-ViewportTexture-after-selecting-a-viewport-in-the-Pick-a-Viewport-popup

Fix forcing `ViewportTexture` after selecting a viewport in the "Pick a Viewport" popup
Thaddeus Crews 6 ماه پیش
والد
کامیت
0edb0e17f8
1فایلهای تغییر یافته به همراه3 افزوده شده و 2 حذف شده
  1. 3 2
      editor/editor_properties.cpp

+ 3 - 2
editor/editor_properties.cpp

@@ -3227,8 +3227,9 @@ void EditorPropertyResource::_viewport_selected(const NodePath &p_path) {
 		return;
 	}
 
-	Ref<ViewportTexture> vt;
-	vt.instantiate();
+	Ref<ViewportTexture> 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);