[Bf-blender-cvs] [f086036] object_nodes: Use dynamic socket lists for mesh and dupli output nodes for convenience.

Lukas Tönne noreply at git.blender.org
Wed Dec 23 14:46:07 CET 2015


Commit: f0860367f16122c614d6515950bc62889af90d6b
Author: Lukas Tönne
Date:   Wed Dec 23 14:45:33 2015 +0100
Branches: object_nodes
https://developer.blender.org/rBf0860367f16122c614d6515950bc62889af90d6b

Use dynamic socket lists for mesh and dupli output nodes for convenience.

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

M	release/scripts/nodes/geometry_nodes.py
M	release/scripts/nodes/instancing_nodes.py

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

diff --git a/release/scripts/nodes/geometry_nodes.py b/release/scripts/nodes/geometry_nodes.py
index bd81aba..af7d5cd 100644
--- a/release/scripts/nodes/geometry_nodes.py
+++ b/release/scripts/nodes/geometry_nodes.py
@@ -95,16 +95,32 @@ def compile_modifier_inputs(compiler, obptr):
     return ob, tfm, itfm
 
 
-class GeometryOutputNode(GeometryNodeBase, ObjectNode):
+class GeometryOutputNode(GeometryNodeBase, ObjectNode, DynamicSocketListNode):
     '''Geometry output'''
     bl_idname = 'GeometryOutputNode'
     bl_label = 'Output'
 
     def init(self, context):
-        self.inputs.new('GeometrySocket', "")
+        if self.is_updating:
+            return
+        with self.update_lock():
+            self.update_socket_list(self.inputs, 'GeometrySocket')
+
+    def update(self):
+        if self.is_updating:
+            return
+        with self.update_lock():
+            self.update_socket_list(self.inputs, 'GeometrySocket')
+
+    def insert_link(self, link):
+        if self.is_updating:
+            return
+        with self.update_lock():
+            self.update_socket_list(self.inputs, 'GeometrySocket', insert=link.to_socket)
 
     def compile(self, compiler):
-        compiler.map_input(0, compiler.graph_output("mesh"))
+        result = self.compile_socket_list(compiler, self.inputs, "PASS_MESH", "MESH_COMBINE", "VALUE_MESH")
+        compiler.link(result, compiler.graph_output("mesh"))
 
 
 class GeometryElementInfoNode(GeometryNodeBase, ObjectNode):
diff --git a/release/scripts/nodes/instancing_nodes.py b/release/scripts/nodes/instancing_nodes.py
index 1a6341a..bd21a54 100644
--- a/release/scripts/nodes/instancing_nodes.py
+++ b/release/scripts/nodes/instancing_nodes.py
@@ -24,7 +24,7 @@ from bpy.types import Operator, ObjectNode, NodeTree, Node
 from bpy.props import *
 from nodeitems_utils import NodeCategory, NodeItem
 from mathutils import *
-from common_nodes import NodeTreeBase, NodeBase, enum_property_copy, enum_property_value_prop
+from common_nodes import NodeTreeBase, NodeBase, DynamicSocketListNode, enum_property_copy, enum_property_value_prop
 import group_nodes
 
 ###############################################################################
@@ -81,16 +81,32 @@ def compile_object(compiler, ptr):
     return node.outputs[0]
 
 
-class OutputNode(InstancingNodeBase, ObjectNode):
+class OutputNode(InstancingNodeBase, ObjectNode, DynamicSocketListNode):
     '''Dupli output'''
     bl_idname = 'InstancingOutputNode'
     bl_label = 'Output'
 
     def init(self, context):
-        self.inputs.new('DupliSocket', "")
+        if self.is_updating:
+            return
+        with self.update_lock():
+            self.update_socket_list(self.inputs, 'DupliSocket')
+
+    def update(self):
+        if self.is_updating:
+            return
+        with self.update_lock():
+            self.update_socket_list(self.inputs, 'DupliSocket')
+
+    def insert_link(self, link):
+        if self.is_updating:
+            return
+        with self.update_lock():
+            self.update_socket_list(self.inputs, 'DupliSocket', insert=link.to_socket)
 
     def compile(self, compiler):
-        compiler.map_input(0, compiler.graph_output("dupli.result"))
+        result = self.compile_socket_list(compiler, self.inputs, "PASS_DUPLIS", "DUPLIS_COMBINE", "VALUE_DUPLIS")
+        compiler.link(result, compiler.graph_output("dupli.result"))
 
 
 class MakeDupliNode(InstancingNodeBase, ObjectNode):




More information about the Bf-blender-cvs mailing list