Closed KelSolaar closed 4 months ago
I will look at creating some subclasses that have an execution route instead of relying on the ports, that would allow for adding some control flow nodes, e.g., for loop and conditional branching.
I have implemented support for looping, this can be done sequentially, via thread or multiprocessing using the colour.utilities.For
, colour.utilities.ParallelForThread
and colour.utilities.ParallelForMultiProcess
nodes respectively.
I'll have more time for a review on Sunday time in central US. Looks promising!
I'm going to merge this one! The feature is at a point where it works really well. What might happen in the future though is that we will extract this in its own repository but for now here is good as colour is the lowest common denominator in our projects.
Summary
This PR implements support for a port-based node-graph via 6 new classes:
colour.utilities.Port
colour.utilities.PortNode
colour.utilities.PortGraph
colour.utilities.For
colour.utilities.ParallelForThread
colour.utilities.ParallelForMultiProcess
The idea behind it is to be able to construct processing graph, initially with code but possibly using a UI in the future.
The API is as follows:
This is obviously a simple and naive example but the immediate use case is for colour-hdri:
Preflight
Code Style and Quality
colour
,colour.models
.Documentation