[Bf-blender-cvs] [37b9805] object_nodes: Node compiler function for adding proxy nodes.

Lukas Tönne noreply at git.blender.org
Sun Dec 6 13:44:42 CET 2015


Commit: 37b980565a913a84f403f05e837624b1bbe7d9fc
Author: Lukas Tönne
Date:   Sun Dec 6 12:49:16 2015 +0100
Branches: object_nodes
https://developer.blender.org/rB37b980565a913a84f403f05e837624b1bbe7d9fc

Node compiler function for adding proxy nodes.

===================================================================

M	release/scripts/nodes/common_nodes.py
M	release/scripts/nodes/node_compiler.py

===================================================================

diff --git a/release/scripts/nodes/common_nodes.py b/release/scripts/nodes/common_nodes.py
index 193c3a3..69e8080 100644
--- a/release/scripts/nodes/common_nodes.py
+++ b/release/scripts/nodes/common_nodes.py
@@ -72,9 +72,7 @@ class NodeTreeBase():
             # proxies for inputs/outputs
             bnode_inputs = StringDict()
             for binput in bnode.inputs:
-                itype = socket_type_to_bvm(binput)
-                
-                proxy = compiler.add_node("PASS_%s" % itype)
+                proxy = compiler.add_proxy(socket_type_to_bvm(binput))
                 bnode_inputs[binput.identifier] = proxy.outputs[0]
                 input_map[(bnode, binput)] = proxy.inputs[0]
 
@@ -83,9 +81,7 @@ class NodeTreeBase():
             
             bnode_outputs = StringDict()
             for boutput in bnode.outputs:
-                otype = socket_type_to_bvm(boutput)
-                
-                proxy = compiler.add_node("PASS_%s" % otype)
+                proxy = compiler.add_proxy(socket_type_to_bvm(boutput))
                 bnode_outputs[boutput.identifier] = proxy.inputs[0]
                 output_map[(bnode, boutput)] = proxy.outputs[0]
 
diff --git a/release/scripts/nodes/node_compiler.py b/release/scripts/nodes/node_compiler.py
index 9ce2819..a2c0ffa 100644
--- a/release/scripts/nodes/node_compiler.py
+++ b/release/scripts/nodes/node_compiler.py
@@ -122,6 +122,9 @@ class NodeCompiler:
             raise Exception("Can not add node of type %r" % type)
         return NodeWrapper(node)
 
+    def add_proxy(self, type):
+        return self.add_node("PASS_%s" % type)
+
     def graph_output(self, name):
         out_node, out_socket = self.graph.get_output(name)
         return InputWrapper(out_node, out_node.inputs[out_socket])




More information about the Bf-blender-cvs mailing list