In general, I'm trying to get us closer to reaching the following two goals:
- Fully declarative node interface (the *_update function was imperative in this context, because it would change the sockets directly). This makes it easier to reason about how nodes behave, because a node can't do arbitrary things in its update function anymore. Being able to reason about nodes allows for more complex features like type inferencing.
- Have all inputs to a node as sockets instead of in node->storage. This gives users the most flexibility, because everything inside a group can be exposed to the outside.
This patch is clearly focused on the first part, but the second goal impacts the API. More specifically, without the second goal I'd opt for an API that uses if-else statements to handle socket availability.
Just a few nodes are updated in this patch to test the API. In some cases like the Switch node, this new API results in quite a bit more code. However, hopefully we'll find a better solution in the future for nodes with changing data types making this a non-issue.