* @deprecated Will be removed in 0.9 * Checks that the node type matches the node type registered, * used when replacing a nodetype by a newer version during execution * this replaces the ones using the old version with the new version
()
| 1116 | * this replaces the ones using the old version with the new version |
| 1117 | */ |
| 1118 | checkNodeTypes() { |
| 1119 | const { _nodes } = this |
| 1120 | for (const [i, node] of _nodes.entries()) { |
| 1121 | const ctor = LiteGraph.registered_node_types[node.type] |
| 1122 | if (node.constructor == ctor) continue |
| 1123 | |
| 1124 | console.log("node being replaced by newer version:", node.type) |
| 1125 | const newnode = LiteGraph.createNode(node.type) |
| 1126 | if (!newnode) continue |
| 1127 | _nodes[i] = newnode |
| 1128 | newnode.configure(node.serialize()) |
| 1129 | newnode.graph = this |
| 1130 | this._nodes_by_id[newnode.id] = newnode |
| 1131 | |
| 1132 | if (node.inputs) newnode.inputs = [...node.inputs] |
| 1133 | if (node.outputs) newnode.outputs = [...node.outputs] |
| 1134 | } |
| 1135 | this.updateExecutionOrder() |
| 1136 | } |
| 1137 | |
| 1138 | // ********** GLOBALS ***************** |
| 1139 | trigger(action: string, param: unknown) { |
nothing calls this directly
no test coverage detected