diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-08-08 16:27:38 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-08 16:27:38 +0200 |
commit | 660828e7718f041ee6c6317f97ba6e3fd7f31281 (patch) | |
tree | bcccc2f93e1299fd58628d41550fe2f614dd8d86 /editor | |
parent | db523dd4001b9b1c0ec6c2ca844f730cb072ada2 (diff) | |
parent | bd0819d4a056c1d9e643d943a5f3601c9f73d219 (diff) |
Merge pull request #63253 from V-Sekai/disable_sprite_conversion_on_foreign_nodes
Diffstat (limited to 'editor')
-rw-r--r-- | editor/plugins/sprite_2d_editor_plugin.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/editor/plugins/sprite_2d_editor_plugin.cpp b/editor/plugins/sprite_2d_editor_plugin.cpp index 3323d865c2..7d350fd46f 100644 --- a/editor/plugins/sprite_2d_editor_plugin.cpp +++ b/editor/plugins/sprite_2d_editor_plugin.cpp @@ -160,6 +160,11 @@ void Sprite2DEditor::_menu_option(int p_option) { } void Sprite2DEditor::_update_mesh_data() { + if (node->get_owner() != get_tree()->get_edited_scene_root()) { + err_dialog->set_text(TTR("Can't convert a Sprite2D from a foreign scene.")); + err_dialog->popup_centered(); + } + Ref<Texture2D> texture = node->get_texture(); if (texture.is_null()) { err_dialog->set_text(TTR("Sprite2D is empty!")); |