Skip to content

Commit

Permalink
Merge pull request #77473 from KoBeWi/get_tree().get_root().get_tree(…
Browse files Browse the repository at this point in the history
…).get_root().get_tree().get_root().get_tree().get_root().get_tree().get_root().get_tree().get_root().get_tree().get_root().get_tree().get_edited_scene_root()

Don't create bones from empty scene
  • Loading branch information
akien-mga committed May 25, 2023
2 parents 89913c4 + e5b6b3e commit 2eec9a6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion editor/plugins/canvas_item_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 2eec9a6

Please sign in to comment.