Don't create bones from empty scene

This commit is contained in:
kobewi 2023-05-25 14:57:08 +02:00
parent a67d37f7cf
commit e5b6b3e1e3

View file

@ -4587,7 +4587,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) {