-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
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
Implement project-wide node groups #60965
Implement project-wide node groups #60965
Conversation
844d8e9
to
a876f8f
Compare
Should "Local Groups" be renamed to "Scene Groups" to make it more obvious that those groups are scoped to the currently open scene in the editor? |
What icon could I use for another remove button? :) |
I have no idea. I looked around for a good icon to use and I can't find one. Maybe someone else has an idea? |
A checkbox in the dialog is good. But the text to the right of the checkbox be a part of the checkbox (using the |
a876f8f
to
be14cc3
Compare
It looks great! One change I would make is removing "This action is undoable!", because other actions that are undoable don't have anything saying that. Usually it's the other way around, with actions that can't be undone having a warning and everything else is just assumed to be undoable. Also, I don't know if this will make it too cluttered, but you could try adding icons to "Scene Groups" and "Global Groups" in the tree. The PackedScene icon will work for scene and Environment for Global: I don't have any more suggestions regarding the design. I'll do a review of the code when I get a chance to :) |
be14cc3
to
166997c
Compare
I would review this right now, but it doesn't compile :( The error messages are referring to HashMap, so I assume it's a difference introduced by #60881 or #60999. https://github.com/godotengine/godot/runs/6427783069?check_suite_focus=true |
@fire-forge I need to know when node added to the scene tree. Is there any signal for this? |
b6bb8c1
to
92e7648
Compare
74e28e2
to
958699a
Compare
Removed hacks related to disabled Checkbox state, because Checkbox in Tree now has a disabled state: #84845 |
The OP is unclear whether this closes godotengine/godot-proposals#3351 or not. So, does it? |
Thanks! And thank you for sticking around for over a year to see this finished 🙂 |
Just saw this PR in the changelog for 4.3 dev1. The description of local groups is kinda confusing.
What does this mean? Does this mean that if I have two separate scenes with a bunch of nodes in them, and both scenes define a group called "test", then calling Does this mean that the old behavior of groups was what is now called "global"? But now we have "local" groups in addition to that? How can we know in code which group is local and which is global? This needs to be thoroughly documented on this page: https://docs.godotengine.org/en/stable/tutorials/scripting/groups.html |
It's much simpler than you're imagining. The underlying logic of groups is unchanged. Groups with the same name are the same. All groups are stored alongside the node they belong to in a PackedScene. When you load the scene, every node's group is kept track of and displayed in the Group Editor for easy access.
The only difference between "local" and "global" groups is... The "global" groups and their descriptions are stored in the Project Settings (underneath In code, you may write something like this (I don't see why you'd need to but...): static func is_global_group(group_name):
return ProjectSettings.has_setting("global_group/" + group_name)
I wouldn't say "thoroughly" because again, your code would be entirely unaffected, but the page does need to be entirely refreshed for the new interface, yes. |
@Mickeon thanks for the explanations, it makes it a bit clearer. So it's the opposite of what I was imagining: the old groups are what "local" means, but now we have "global" groups which is editable in the project settings and that's the only difference between the two (from the usage perspective). |
Many people are able to reproduce a crash at #86844 |
The "Manage Groups" dialog provided a way to add multiple nodes to a group all at once. Is there still a way to do that after these changes? |
I'm afraid that's not as doable as before. That's mainly because the Node dock refuses to work when more than one Node is selected. I can see someone lifting this limitation in the future. It probably was done because it does not play nice with the Signals sub-section. |
Do we need to do up a proposal for this or is it obvious to everyone that the manager is going to be missed? |
It's best to open a proposal if it doesn't exist yet. |
In my opinion this proposal covers it. |
It's a general quality of life. For anyone reading this with the know-how, they should feel free to open a PR. The implementation details should be discussed in the PR itself, I feel. Namely, what to do with the Signals tab on the side. |
This commit based on #24262.
Fix godotengine/godot-proposals#3789 and maybe godotengine/godot-proposals#3351 :)
Bugsquad edit:
Global groups editor in Project Settings.
Editor
Remove global group dialog
Reworked Groups Editor.
Groups Editor
Ability to create Global and Local groups.
Ability to Covert Global to Local and Local to Global. Rename. Delete.
P.S. I have one problem. I store local groups cache inside
Map<Node *, Set<StringName>>
. When I opened scene, I'm storing all local groups into this Set where key is aedited_scene_root_node
. I want to know the moment, when scene is closing and I can release a data from the Map.I use
Map<Node *, Set<StringName>>
, because when you adding local group and unckeck it from all nodes, you can lose it when you are switching tabs.