Commit graph

3 commits

Author SHA1 Message Date
Candice Bentéjac
3c57afb4d0 [tests] Simplify registration/unregistration of nodes in tests
Add two methods that are local to tests, `registerNodeDesc` and
`unregisterNodeDesc`, which handle the registration and unregistration
of `NodePlugins` from a node description. This reduces the amount of
code in tests whenever `NodePlugin` need to be instantiated prior
to their registration and so on.
2025-06-05 14:40:14 +02:00
Candice Bentéjac
777ed4207e [tests] Use the NodePluginManager instance in the unit tests
The plugin manager is now effectively used for all the operations that
involve registering or unregistering nodes.
2025-06-05 14:40:10 +02:00
Yann Lanthony
90acb93ea8 [core] Trigger node desc creation callback only for explicit node creation
The desc.Node.onCreated callback is a hook in the Node API for developers to
write custom behavior on a node first initialization.
By being called in the core.Node constructor, this was triggered in several situations
that don't match this idea and with unpredictable side effects (graph loading, node re-creation on undo...).

* Make `onNodeCreated` callback an explicit method on desc.Node.
* Remove the call to node descriptor's `onNodeCreated` callback outside core.Node constructor.
* Trigger this callback on explicit node creation (adding new node to graph, init a graph from a template).
2025-02-14 11:42:22 +01:00