Open nonunknown opened 4 years ago
Currently, the update of group editor and scene tree editor are manually trigged.
I think maybe a "group_updated" signal should be added to Node. So that the group editor and scene tree editor can update themselves when the signal is emitted.
I was thinking about a workaround for now, maybe if we could go to groups tab via script , the code listed on top of this post would work too. Btw I found a bug when you call get_selected_node() and try to add a group to its children i.e "test", the code runs fine, but if you go to anyone of this children you cant add a group called "test" again, but if you run the game and list this child's groups its shows empty.
Can anyone still reproduce this bug in Godot 3.2.3 or any later release?
If yes, please ensure that an up-to-date Minimal Reproduction Project (MRP) is included in this report (a MRP is a zipped Godot project with the minimal elements necessary to reliably trigger the bug). You can upload ZIP files in an issue comment with a drag and drop.
Not 100% sure if this is the right bug report, but in Godot 4.0.2 (using @tool) I am seeing that somenode.add_to_group("foo") does not show that group in the groups inspector. It does seem to work overall, but it's not saved as so.
The issue seems still valid in 4.1. Here's a simpler test code:
@tool
extends Node
func _ready() -> void:
await get_tree().create_timer(5).timeout
print("gr")
add_to_group("gr", true)
Open the scene, click the node and go to Group tab. The group is added, but you need to manually refresh the group list and scene tree. I think we just need to expose some way to update these nodes from code 🤔
@donn-xx add_to_group()
has a second argument that makes the group persistent. It's false
by default.
Godot version: 3.2 OS/device including version: ubuntu 19.10 Issue description: I'm creating a plugin related to group managing, but when use a function like node.add_to_group(groupname) the groups built'in tab doesnt recognize this (sometimes it works, but if you first add a number string:
Steps to reproduce:
Create a plugin Create a way to add_groups in-editor
ImprovedGroups.gd
ManagerGroups.gd (the dock scene root script)
** Update
checked godot's source, possibily could be cuz of this line:
groups_editor.cpp line 195