-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Allow for editor-only nodes #56446
base: master
Are you sure you want to change the base?
Allow for editor-only nodes #56446
Conversation
0dd69e0
to
f5b12f4
Compare
Rebased, made a few tweaks and removed the |
That reminds me, should we make Position2D/Position3D draw in projects by default? They can be made editor-only again with your PR now. Being able to see Position nodes in projects can be useful to diagnose various issues without having to add small cube MeshInstances. |
Welcome to my way of debugging AI paths xDDD Yes please to anything that will make it better |
I did a small test based on this comment:
Apparently, when an editor-only node contains some resource, that resource will be loaded anyway. The reason is that you are stripping the node on load, but any resource referenced by that node is still in the scene and is being loaded. Any chance this could be fixed? It would be the best selling point for this feature. |
f5b12f4
to
26d4295
Compare
Rebased and changed the following: @KoBeWi I will do some research on how this could be achieved, but I have a feeling that this might get quite complex because a resource can be shared by editor-only and "normal" nodes. This would require to check if a resource is unused before loading it, which may be tricky with the current metadata approach. |
It would be good to add the Editor Only toggle to the Scene tree node context menu. It could be a replacement for the toolbar button or they could both be kept; I'm not sure which would be better. |
This is a really great feature, but it clashes with other similar stuff we have, and I am not sure the way its displayed is the best. I was thinking about renaming some editor_only flags we have in nodes like Light to edited_scene_only or something like this. Might be worth doing some work on this after Beta so we can merge it properly. |
What's the status on this, now that 4.0 is released? Also, only a handful of nodes currently have Editor Only properties. If we go forward with this PR or #77301, I'd suggest deprecating those properties (we have a system for that now). |
I think this PR has a lot of value and it would be nice to revive it, I will try to write down proper feedback again ASAP so we can finalize it. |
Would this flag also allow runtime-only nodes? Because it would be useful to hide things only in editor too, without requiring code, and I think it could be through this same feature. In fact, it would be best to already go one step further and do a more powerful and generic way to exclude nodes/resources anywhere. IMO the best implementation would be through a property
This property would have the special value In terms of UI, you could make the button toggle just the editor-only state by default, and show a more complete context menu with specific toggles if you right-click it or if it's any value except |
I would go with a dropdown menu at the top of the inspector with Enabled/Disabled/Editor-only (RMB context menu is also fine but less discoverable), not adding a clickable icon, and signifying state in the scene tree view with graying out the name for disabled and coloring it for editor-only (I think yellow is taken, so maybe blue?) |
This PR introduces an editor-only flag, providing a possible solution for godotengine/godot-proposals#3433. It can be used to mark nodes which should not be loaded added to the SceneTree when running the game or when the project is exported.
Although everything seems to work properly, I still would like to find a way to completely strip editor-only nodes from exported projects.
Changes:
Add editor-only flag for all Node types (implemented with object metadata, so no overhead for normal nodes)
Editor-only nodes are highlighted in the SceneTreeEditor. The flag can be set/removed with the toggle button in the menu band or removed with the button which appears directly in the SceneTreeEditor
Added project setting to keep editor-only nodes when running the project.
As always, feedback and testing is welcome :)
Bugsquad edit: This closes godotengine/godot-proposals#3433.