1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-16 14:00:40 +00:00

Do not remove subviewport nodes in thumbnail preview scene

This commit is contained in:
daniel080400
2025-06-19 01:31:15 +08:00
parent 09ed9d4a93
commit cd6e5ba9f4

View File

@@ -583,13 +583,6 @@ Ref<Texture2D> EditorPackedScenePreviewPlugin::generate_from_path(const String &
} }
void EditorPackedScenePreviewPlugin::_setup_scene_3d(Node *p_node) const { void EditorPackedScenePreviewPlugin::_setup_scene_3d(Node *p_node) const {
// Do not account any SubViewport at preview scene, as it would not render correctly
if (Object::cast_to<SubViewport>(p_node) && p_node->get_parent()) {
p_node->get_parent()->remove_child(p_node);
callable_mp(p_node, &Node::queue_free).call_deferred();
return;
}
// Don't let window to popup // Don't let window to popup
Window *window = Object::cast_to<Window>(p_node); Window *window = Object::cast_to<Window>(p_node);
if (window) { if (window) {
@@ -639,13 +632,6 @@ void EditorPackedScenePreviewPlugin::_setup_scene_3d(Node *p_node) const {
} }
void EditorPackedScenePreviewPlugin::_setup_scene_2d(Node *p_node) const { void EditorPackedScenePreviewPlugin::_setup_scene_2d(Node *p_node) const {
// Do not account any SubViewport at preview scene, as it would not render correctly
if (Object::cast_to<SubViewport>(p_node) && p_node->get_parent()) {
p_node->get_parent()->remove_child(p_node);
callable_mp(p_node, &Node::queue_free).call_deferred();
return;
}
// Don't let window to popup // Don't let window to popup
Window *window = Object::cast_to<Window>(p_node); Window *window = Object::cast_to<Window>(p_node);
if (window) { if (window) {