Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initialize editor values on first launch #75799

Merged
merged 1 commit into from
Apr 10, 2023

Conversation

KoBeWi
Copy link
Member

@KoBeWi KoBeWi commented Apr 7, 2023

#74682 moved some defaults from constructor to clear() method. Normally clear() is called at startup, but there is only one case when it's not. When you open a fresh new project, which doesn't have any scene and opens an empty editor 🙃

Fixes #75749

@capnm
Copy link
Contributor

capnm commented Apr 7, 2023

It looped even in non-minimal project width scenes, the initialization seems to fix everything ...

@KoBeWi
Copy link
Member Author

KoBeWi commented Apr 7, 2023

Opening any scene (even if it fails) will call reset(). So the only time when it could happen in non-empty project is when you don't have a default scene and disable scene restoring.

@capnm
Copy link
Contributor

capnm commented Apr 7, 2023

EDIT: Was also broken on every project that starts without a scene open + default settings.
(E.g. default scene, which is autoloaded calls a reset)

Now I see at project start (c151d32 + your PR)

ERROR: Condition "!instance" is true.
   at: instance_set_visible (servers/rendering/renderer_scene_cull.cpp:954)

EDIT: confirmed - the Error is coming from this PR.

@capnm
Copy link
Contributor

capnm commented Apr 8, 2023

RendererSceneCull::instance_set_visible(RendererSceneCull * const this, RID p_instance, bool p_visible) (servers/rendering/renderer_scene_cull.cpp:954)
	Instance *instance = instance_owner.get_or_null(p_instance);
	ERR_FAIL_COND(!instance);

RenderingServerDefault::instance_set_visible(RenderingServerDefault * const this, RID p1, bool p2) (servers/rendering/rendering_server_default.h:771)
Node3DEditor::clear(Node3DEditor * const this) (editor/plugins/node_3d_editor_plugin.cpp:7869)
Node3DEditor::Node3DEditor(Node3DEditor * const this) (editor/plugins/node_3d_editor_plugin.cpp:8657)
Node3DEditorPlugin::Node3DEditorPlugin(Node3DEditorPlugin * const this) (editor/plugins/node_3d_editor_plugin.cpp:8781)
EditorNode::EditorNode(EditorNode * const this) (editor/editor_node.cpp:7884)
Main::start() (main/main.cpp:2811)
main(int argc, char ** argv) (platform/linuxbsd/godot_linuxbsd.cpp:71)

@YuriSizov YuriSizov merged commit 533ec86 into godotengine:master Apr 10, 2023
@YuriSizov
Copy link
Contributor

Thanks!

@YuriSizov
Copy link
Contributor

Cherry-picked for 4.0.3.

@KoBeWi KoBeWi deleted the sector_clear branch April 10, 2023 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2D-View: "Use Grid Snap" - loop in thread in git-tip
4 participants