mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2025-01-10 12:59:40 +01:00
Now MatMakerGDEditor will properly delete all previous graph nodes when it has to open a new MMMaterial.
This commit is contained in:
parent
034aed2b73
commit
32b3d1bd0d
@ -115,15 +115,21 @@ void MatMakerGDEditor::recreate() {
|
||||
_recreation_in_progress = true;
|
||||
_graph_edit->clear_connections();
|
||||
|
||||
LocalVector<MMGraphNode *> nodes;
|
||||
|
||||
for (int i = 0; i < _graph_edit->get_child_count(); ++i) {
|
||||
MMGraphNode *c = Object::cast_to<MMGraphNode>(_graph_edit->get_child(i));
|
||||
|
||||
if (c) {
|
||||
_graph_edit->remove_child(c);
|
||||
c->queue_delete();
|
||||
nodes.push_back(c);
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < nodes.size(); ++i) {
|
||||
_graph_edit->remove_child(nodes[i]);
|
||||
}
|
||||
|
||||
if (!_material.is_valid()) {
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user