godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
91.59k stars 21.27k forks source link

Error in get_edited_scene_root: index=-1 #15300

Closed capnm closed 6 years ago

capnm commented 6 years ago

Godot version:

b7b0ffd5c49e950c57eeac1171d0900bbbb69fa6

OS/device including version:

x11

Issue description:

Terminal output by godot tool start:

ERROR: get_edited_scene_root: Index current_edited_scene=-1 out of size (edited_scene.size()=0)
   At: editor/editor_data.cpp:607.
ERROR: get_edited_scene_root: Index current_edited_scene=-1 out of size (edited_scene.size()=0)
   At: editor/editor_data.cpp:607.

gdb

(gdb) b editor/editor_data.cpp:607
(gdb) r -e
Starting program: /usr/local/bin/godot3 -e
...

Thread 1 "godot3" hit Breakpoint 1, EditorData::get_edited_scene_root () at editor/editor_data.cpp:607
607         ERR_FAIL_INDEX_V(current_edited_scene, edited_scene.size(), NULL);
(gdb) bt
#0  EditorData::get_edited_scene_root () at editor/editor_data.cpp:607
#1  0x0000000000f4bdfc in EditorNode::get_edited_scene () at ./editor/editor_node.h:699
#2  CanvasItemEditor::_update_scrollbars () at editor/plugins/canvas_item_editor_plugin.cpp:3189
#3  0x0000000000f4cb92 in CanvasItemEditor::set_state () at editor/plugins/canvas_item_editor_plugin.cpp:465
#4  0x0000000000f624bc in CanvasItemEditor::CanvasItemEditor () at editor/plugins/canvas_item_editor_plugin.cpp:4351
#5  0x0000000000f64a5d in CanvasItemEditorPlugin::CanvasItemEditorPlugin () at editor/plugins/canvas_item_editor_plugin.cpp:4395
#6  0x0000000000c6553f in EditorNode::EditorNode () at editor/editor_node.cpp:5627
#7  0x000000000043cd3e in Main::start () at main/main.cpp:1387
#8  0x000000000041ec56 in main () at platform/x11/godot_x11.cpp:53
(gdb) l
602     current_edited_scene = p_idx;
603     //swap
604 }
605 Node *EditorData::get_edited_scene_root(int p_idx) {
606     if (p_idx < 0) {
607         ERR_FAIL_INDEX_V(current_edited_scene, edited_scene.size(), NULL);
608         return edited_scene[current_edited_scene].root;
609     } else {
610         ERR_FAIL_INDEX_V(p_idx, edited_scene.size(), NULL);
611         return edited_scene[p_idx].root;
akien-mga commented 6 years ago

Confirmed, I get the same when opening any project.

volzhs commented 6 years ago

@groud I was looking into this issue and just saw that you assigned it to yourself. the other one comes from AutotileEditor constructor, just for your information. I'm moving to another issue then. :)

groud commented 6 years ago

No no, I just assign to myself stuff that are related to the 2D editor that I may have to fix later on. If you want to fix it go ahead. ^^