repoint method

void repoint(
  1. SceneDocument scene
)

Re-resolve every group's target against scene, by name.

The editor's door, and only the editor's: a group holds a node object, and an undo that brings a deleted node back brings back a NEW object, leaving the group pointed at the one that went away. Names exist only where the source was read, which is exactly here.

Implementation

void repoint(SceneDocument scene) {
  for (var g in groups) {
    var node = scene.nodeNamed(g.node.name);
    if (node != null) g.node = node;
  }
}