[Bf-blender-cvs] [e57a0ec2116] functions: handle other socket types in operator

Jacques Lucke noreply at git.blender.org
Thu Dec 5 13:14:41 CET 2019


Commit: e57a0ec211623671b6d5216d7685445062ede520
Author: Jacques Lucke
Date:   Thu Dec 5 13:14:23 2019 +0100
Branches: functions
https://developer.blender.org/rBe57a0ec211623671b6d5216d7685445062ede520

handle other socket types in operator

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

M	release/scripts/startup/nodes/function_nodes/groups.py

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

diff --git a/release/scripts/startup/nodes/function_nodes/groups.py b/release/scripts/startup/nodes/function_nodes/groups.py
index 44e9a05e970..8241fa61c82 100644
--- a/release/scripts/startup/nodes/function_nodes/groups.py
+++ b/release/scripts/startup/nodes/function_nodes/groups.py
@@ -316,12 +316,16 @@ class CreateGroupInputForSocket(bpy.types.Operator):
         node.select = False
 
         with skip_syncing():
-            # TODO: handle non data sockets
             new_node = tree.nodes.new(type="fn_GroupInputNode")
             new_node.sort_index = 1000
             new_node.input_name = socket.name
-            new_node.interface_type = "DATA"
-            new_node.data_type = socket.data_type
+            if isinstance(socket, DataSocket):
+                new_node.interface_type = "DATA"
+                new_node.data_type = socket.data_type
+            elif socket.bl_idname == "fn_ExecuteSocket":
+                new_node.interface_type = "EXECUTE"
+            elif socket.bl_idname == "fn_InfluencesSocket":
+                new_node.interface_type = "INFLUENCES"
             new_node.rebuild()
             
             new_node.select = True
@@ -351,12 +355,16 @@ class CreateGroupOutputForSocket(bpy.types.Operator):
         node.select = False
 
         with skip_syncing():
-            # TODO: handle non data sockets
             new_node = tree.nodes.new(type="fn_GroupOutputNode")
             new_node.sort_index = 1000
             new_node.output_name = socket.name
-            new_node.interface_type = "DATA"
-            new_node.data_type = socket.data_type
+            if isinstance(socket, DataSocket):
+                new_node.interface_type = "DATA"
+                new_node.data_type = socket.data_type
+            elif socket.bl_idname == "fn_ExecuteSocket":
+                new_node.interface_type = "EXECUTE"
+            elif socket.bl_idname == "fn_InfluencesSocket":
+                new_node.interface_type = "INFLUENCES"
             new_node.rebuild()
 
             new_node.select = True



More information about the Bf-blender-cvs mailing list