Many parts of the compositor are unnecessarily complicated. This patch
aims at reducing the complexity of writing nodes and making the code
A number of further improvements can be made beyond this patch, but
since it touches all of the node files i consider it preferable to make
a checkpoint and get this approved and verified first.
Currently the compositor mixes nodes (internal copies from bNode) and
actual operations (elementary executable components) in the same graph,
which leads to lots of implicit type assumptions and confusing
Separate these graphs from each other:
- NodeGraph: internal representation of the bNodeTree DNA data. Most nodes have a 1:1 class equivalent, except for a few nodes (groups, switch, muted nodes) which are replaced by simple proxies.
- Operations graph (currently still "ExecutionSystem"):
Actual implementations, generated from the NodeGraph in a second step.
Nodes define a conversion method to transform themselves into a set of
operations based on data copied from DNA nodes.
Dedicated classes: What happens Where
Many functions are in awkward places and pass through multiple different
classes before the final implementation (e.g. node->addLink wrapping
execution system function).
In particular the construction of the NodeGraph and ExecutionSystem
(operation graph) should be handled by compiler classes. These can
store temporary state, like socket maps, and are created only as local
variables for converting DNA nodes to node graph and node graph to
operations graph respectively. That way the graph structures themselves
are largely free of the intricacies of how these structures are
converted and easier to understand.