Graph serialisation update - Links & Reroutes (#279)

* nit

* Add LGraph state POCO

Moves last_link_id, last_node_id and creates same for group and reroute

fix import

* Add new serialisation to LGraph

Add LGraph schema 1
Remove reroute from old serialised graph
Remove brittle inherited types
Ensure stale links are not kept when clearing graph

* Add serialisable exports

* Ensure valid LGraph.state during deserialise
This commit is contained in:
filtered
2024-11-08 10:33:54 +11:00
committed by GitHub
parent 1c40aad87c
commit fc0b8087db
5 changed files with 141 additions and 58 deletions

View File

@@ -1929,8 +1929,8 @@ export class LGraphNode implements Positionable, IPinnable {
}
// UUID: LinkIds
// const nextId = LiteGraph.use_uuids ? LiteGraph.uuidv4() : ++graph.last_link_id
const nextId = ++graph.last_link_id
// const nextId = LiteGraph.use_uuids ? LiteGraph.uuidv4() : ++graph.state.lastLinkId
const nextId = ++graph.state.lastLinkId
//create link class
link_info = new LLink(