diff --git a/flax/Node.py b/flax/Node.py
--- a/flax/Node.py
+++ b/flax/Node.py
@@ -6,7 +6,7 @@ NoChange = "NoChange"
class NodeType:
def __init__(self, iports=None, oports=None):
make_attributes_from_args('iports', 'oports')
- def process(self):
+ def process(self,iports,oports):
pass
# TODO: handle NoChange stuff
@@ -34,10 +34,10 @@ class SumNode(NodeType):
class FadeNode(NodeType):
"""Provides a UI scaler to let you fade a value"""
def __init__(self):
- NodeType.__init__(self, iports={'in1' : Port,
- 'scale1' : Port},
- oports={'out1' : Port},
- def process(self, ports):
+ NodeType.__init__(self, iports={'in1' : Port(),
+ 'scale1' : Port()},
+ oports={'out1' : Port()},
+ def process(self, iports, oports):
ports.out1 = ports.in1 * ports.scale1
class FadeConstellation(Constellation):
@@ -75,3 +75,106 @@ class FadeConstellation(Constellation):
| out
|
"""
+
+Persistence
+node instance saves:
+ node name, id, and such
+ input ports:
+ any port details
+ what the port connects to
+ values:
+ maybe UI.Scale level
+ maybe group contents
+
+
+p=InputPort(node=self,minconns=1,maxconns=2) # an input port to this node
+p.connect(othernode)
+print p.connections()
+p.connect(yetanother)
+
+op=OutputPort(node=self) # an output port
+print op.connections() # lists all the nodes that call us an input node
+op.connect(n) # calls n.connect(self)
+
+
+
+
+Ports
+ Port: "scalar"
+ MultiPort: "array of Port"
+ ^ all wrong
+
+ Ports II:
+ min/max number of connections
+ (failure to fit these numbers means port is "deactivated")
+ "Normal" ports are min=1, max=1
+ "Multiports" are min=0, max=None
+ "Binary" ports are min=2, max=2
+ oh yeah, there are two totally different types of ports
+
+ Input ports: min/max numbers of connections
+ store current connections
+ Output ports: nothing
+ store nothing!
+
+fake node persistence for subtract node
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 8.3
+
+ 0
+ 100
+
+
+
+ very high
+ 395
+ 21
+
+
+
+
+