You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I followed the way Godot's graph editors implement the delete_nodes_request:
func_on_GraphEdit_delete_nodes_request():
varto_delete= []
foriin_graph_edit.get_child_count():
varnode=_graph_edit.get_child(i)
ifnodeisGraphNode:
ifnode.selected:
to_delete.append(node)
fornodeinto_delete:
node.free() # queue_free also works
It properly removes the node, however it causes connections to remain visible, until the graph gets panned around or redrawn (which will then make them disappear):
When redrawing, an error is logged once:
ERROR: Node not found: B.
At: scene/main/node.cpp:1381
Note: I think this never happens in Godot's graph-based editors, because those actually rebuild the entire graph each time a node is deleted... which is very far from the way I implement mine.
This happens even if I use queue_free().
Godot 3.2
Windows 10 64 bits
I followed the way Godot's graph editors implement the
delete_nodes_request
:It properly removes the node, however it causes connections to remain visible, until the graph gets panned around or redrawn (which will then make them disappear):
When redrawing, an error is logged once:
Note: I think this never happens in Godot's graph-based editors, because those actually rebuild the entire graph each time a node is deleted... which is very far from the way I implement mine.
This happens even if I use
queue_free()
.Test project:
GraphEditDeleteRequest.zip
If it's required to remove those connections manually, it would be really nice to have a function to do so.
Edit: indeed, it must be done manually.
The text was updated successfully, but these errors were encountered: