Don't create bones from empty scene

(cherry picked from commit e5b6b3e1e3)
This commit is contained in:
kobewi
2023-06-29 16:03:21 +02:00
committed by Yuri Sizov
parent d86aa32f8c
commit e4986ad4aa

View File

@@ -4589,7 +4589,11 @@ void CanvasItemEditor::_popup_callback(int p_op) {
} break;
case SKELETON_MAKE_BONES: {
HashMap<Node *, Object *> &selection = editor_selection->get_selection();
Node *editor_root = EditorNode::get_singleton()->get_edited_scene()->get_tree()->get_edited_scene_root();
Node *editor_root = get_tree()->get_edited_scene_root();
if (!editor_root || selection.is_empty()) {
return;
}
undo_redo->create_action(TTR("Create Custom Bone2D(s) from Node(s)"));
for (const KeyValue<Node *, Object *> &E : selection) {