godotengine / godot

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

Creating scene from filesystem dock is useless and cause crash #33556

Closed qarmin closed 5 years ago

qarmin commented 5 years ago

Godot version: 3.2.beta.custom_build. 157246ae8 OS/device including version: Ubuntu 19.10 Issue description:

Creating new scene from filesystem dock with name, doesn't create new file with provided name only empty scene tab.

ERROR: _get_modified_time: Failed to get modified time for: res://qwfqwfqwfaf.tscn.
   At: drivers/unix/file_access_unix.cpp:321.
editor/editor_folding.cpp:105:33: runtime error: member call on null pointer of type 'const struct Node'
editor/editor_folding.cpp:105:33: runtime error: member access within null pointer of type 'const struct Node'
handle_crash: Program crashed with signal 11
Dumping the backtrace. Please include this when reporting the bug on https://github.com/godotengine/godot/issues
[1] /usr/bin/godots() [0x140731e] (/mnt/KubuntuWolne/godot/platform/x11/crash_handler_x11.cpp:54)
[2] /lib/x86_64-linux-gnu/libc.so.6(+0x46470) [0x7fa5ba6b0470] (??:0)
[3] EditorFolding::_fill_folds(Node const*, Node const*, Array&, Array&, Array&, Set<Ref<Resource>, Comparator<Ref<Resource> >, DefaultAllocator>&) (/mnt/KubuntuWolne/godot/editor/editor_folding.cpp:105)
[4] EditorFolding::save_scene_folding(Node const*, String const&) (/mnt/KubuntuWolne/godot/editor/editor_folding.cpp:144)
[5] EditorNode::set_current_scene(int) (/mnt/KubuntuWolne/godot/editor/editor_node.cpp:3161 (discriminator 5))
[6] MethodBind1<int>::call(Object*, Variant const**, int, Variant::CallError&) (/mnt/KubuntuWolne/godot/./core/method_bind.gen.inc:775 (discriminator 12))
[7] Object::call(StringName const&, Variant const**, int, Variant::CallError&) (/mnt/KubuntuWolne/godot/core/object.cpp:921 (discriminator 1))
[8] UndoRedo::_process_operation_list(List<UndoRedo::Operation, DefaultAllocator>::Element*) (/mnt/KubuntuWolne/godot/core/undo_redo.cpp:294 (discriminator 4))
[9] UndoRedo::redo() (/mnt/KubuntuWolne/godot/core/undo_redo.cpp:338)
[10] UndoRedo::commit_action() (/mnt/KubuntuWolne/godot/core/undo_redo.cpp:260)
[11] EditorNode::_scene_tab_changed(int) (/mnt/KubuntuWolne/godot/editor/editor_node.cpp:4674 (discriminator 6))
[12] EditorNode::_remove_edited_scene(bool) (/mnt/KubuntuWolne/godot/editor/editor_node.cpp:3032)
[13] EditorNode::_remove_scene(int, bool) (/mnt/KubuntuWolne/godot/editor/editor_node.cpp:3047)
[14] EditorNode::_discard_changes(String const&) (/mnt/KubuntuWolne/godot/editor/editor_node.cpp:2703)
[15] EditorNode::_scene_tab_closed(int, int) (/mnt/KubuntuWolne/godot/editor/editor_node.cpp:4550 (discriminator 2))
[16] EditorNode::_scene_tab_input(Ref<InputEvent> const&) (/mnt/KubuntuWolne/godot/editor/editor_node.cpp:4596)
[17] MethodBind1<Ref<InputEvent> const&>::call(Object*, Variant const**, int, Variant::CallError&) (/mnt/KubuntuWolne/godot/./core/method_bind.gen.inc:775 (discriminator 12))
[18] Object::call(StringName const&, Variant const**, int, Variant::CallError&) (/mnt/KubuntuWolne/godot/core/object.cpp:921 (discriminator 1))
[19] Object::emit_signal(StringName const&, Variant const**, int) (/mnt/KubuntuWolne/godot/core/object.cpp:1218 (discriminator 1))
[20] Object::emit_signal(StringName const&, Variant const&, Variant const&, Variant const&, Variant const&, Variant const&) (/mnt/KubuntuWolne/godot/core/object.cpp:1261)
[21] Viewport::_gui_call_input(Control*, Ref<InputEvent> const&) (/mnt/KubuntuWolne/godot/scene/main/viewport.cpp:1626 (discriminator 2))
[22] Viewport::_gui_input_event(Ref<InputEvent>) (/mnt/KubuntuWolne/godot/scene/main/viewport.cpp:1944 (discriminator 3))
[23] Viewport::input(Ref<InputEvent> const&) (/mnt/KubuntuWolne/godot/scene/main/viewport.cpp:2789 (discriminator 2))
[24] Viewport::_vp_input(Ref<InputEvent> const&) (/mnt/KubuntuWolne/godot/scene/main/viewport.cpp:1410)
[25] MethodBind1<Ref<InputEvent> const&>::call(Object*, Variant const**, int, Variant::CallError&) (/mnt/KubuntuWolne/godot/./core/method_bind.gen.inc:775 (discriminator 12))
[26] Object::call(StringName const&, Variant const**, int, Variant::CallError&) (/mnt/KubuntuWolne/godot/core/object.cpp:921 (discriminator 1))
[27] Object::call(StringName const&, Variant const&, Variant const&, Variant const&, Variant const&, Variant const&) (/mnt/KubuntuWolne/godot/core/object.cpp:848)
[28] SceneTree::call_group_flags(unsigned int, StringName const&, StringName const&, Variant const&, Variant const&, Variant const&, Variant const&, Variant const&) (/mnt/KubuntuWolne/godot/scene/main/scene_tree.cpp:275)
[29] SceneTree::input_event(Ref<InputEvent> const&) (/mnt/KubuntuWolne/godot/scene/main/scene_tree.cpp:430 (discriminator 6))
[30] InputDefault::_parse_input_event_impl(Ref<InputEvent> const&, bool) (/mnt/KubuntuWolne/godot/main/input_default.cpp:416)
[31] InputDefault::parse_input_event(Ref<InputEvent> const&) (/mnt/KubuntuWolne/godot/main/input_default.cpp:260)
[32] InputDefault::flush_accumulated_events() (/mnt/KubuntuWolne/godot/main/input_default.cpp:679)
[33] OS_X11::process_xevents() (/mnt/KubuntuWolne/godot/platform/x11/os_x11.cpp:2692)
[34] OS_X11::run() (/mnt/KubuntuWolne/godot/platform/x11/os_x11.cpp:3257)
[35] /usr/bin/godots(main+0x367) [0x13fe2cd] (/mnt/KubuntuWolne/godot/platform/x11/godot_x11.cpp:57)
[36] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf3) [0x7fa5ba6911e3] (??:0)
[37] /usr/bin/godots(_start+0x2e) [0x13fdeae] (??:?)

Steps to reproduce: jfile

Xrayez commented 5 years ago

It's not completely useless, you need to select one of the "Create Root Node" nodes on the scene tree dock, saving the scene will create a new scene file. I didn't find this intuitive either though. Might be a regression/bug as well? Ideally it would be better if the scene is saved automatically once the scene root type is selected instead of hitting Ctrl+S.

But the fact that one can start creating a new scene once the previous action is not finished is a bug.

Xrayez commented 5 years ago

I get the same backtrace except for this on Windows:

[0] VisualScript::is_tool (modules\visual_script\visual_script.cpp:963)
...
KoBeWi commented 5 years ago

The option is extremely useful. It allows you to skip the saving dialog, using filesystem dock, which is easier to navigate. But it doesn't create a file, because it's impossible to have truly empty scene.

Ideally it would be better if the scene is saved automatically once the scene root type is selected

This actually makes sense.

But the fact that one can start creating a new scene once the previous action is not finished is a bug.

There's no way to really enforce that.

Anyways, the problem with this option being non-intuitive should probably go to another issue.