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

Add SceneTree.get_node_count_in_group() #78206

Merged
merged 1 commit into from
Dec 14, 2023

Conversation

alula
Copy link
Contributor

@alula alula commented Jun 13, 2023

Adds a more efficient way to get the number of nodes in specified group.

This extra method is an alternative to a common get_tree().get_nodes_in_group("group_name").size() use case, but without creating a redundant array.

Closes godotengine/godot-proposals#7080

@alula alula requested review from a team as code owners June 13, 2023 22:41
@AThousandShips
Copy link
Member

AThousandShips commented Jun 14, 2023

The documentation needs to be in alphabetical order, you can most easily accomplish this by using --doctool on the compiled editor version of your code, once that is fixed I or someone else can approve the workflows

Make sure to use git commit --amend when fixing this

@alula alula force-pushed the node-count-in-group branch from 6010df2 to bddf246 Compare June 14, 2023 17:20
@alula
Copy link
Contributor Author

alula commented Jun 14, 2023

done!

@soloparatolos
Copy link

@AThousandShips Is there a possibility to get this reviewed and hopefully merged for 4.2.1? It would really helpful for the project I'm working on.

@AThousandShips
Copy link
Member

AThousandShips commented Dec 9, 2023

Unlikely to be cherry picked I'd say, we mostly cherry pick bugfixes, it'd maybe get into 4.3, and we'd see about 4.2.x, 4.2.1 is a bug fix patch mainly so unlikely to get in that even if it's merged soon

@soloparatolos
Copy link

I build from master regularly so I'll keep an eye if it gets merged. Thanks and sorry to bother you.

Copy link
Member

@kleonc kleonc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@YuriSizov YuriSizov modified the milestones: 4.x, 4.3 Dec 13, 2023
@YuriSizov YuriSizov merged commit 16d1d85 into godotengine:master Dec 14, 2023
@YuriSizov
Copy link
Contributor

Thanks!

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.

Add get_node_count_in_group(group) to SceneTree
7 participants