File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 22 "name" : "Node to Python" ,
33 "description" : "Convert Geometry Node Groups to a Python add-on" ,
44 "author" : "Brendan Parmer" ,
5- "version" : (1 , 2 , 2 ),
5+ "version" : (1 , 2 , 4 ),
66 "blender" : (3 , 0 , 0 ),
77 "location" : "Node" ,
88 "category" : "Node" ,
@@ -222,12 +222,14 @@ def process_node_group(node_group, level):
222222 f"name = \" { node_group .name } \" )\n " ))
223223 file .write ("\n " )
224224
225+ inputs_set = False
226+
225227 #initialize nodes
226228 file .write (f"{ inner } #initialize { ng_name } nodes\n " )
227229 for node in node_group .nodes :
228230 if node .bl_idname == 'GeometryNodeGroup' :
229231 process_node_group (node .node_tree , level + 1 )
230- elif node .bl_idname == 'NodeGroupInput' :
232+ elif node .bl_idname == 'NodeGroupInput' and not inputs_set :
231233 file .write (f"{ inner } #{ ng_name } inputs\n " )
232234 for i , input in enumerate (node .outputs ):
233235 if input .bl_idname != "NodeSocketVirtual" :
@@ -264,6 +266,7 @@ def process_node_group(node_group, level):
264266 f"{ socket .max_value } \n " ))
265267 file .write ("\n " )
266268 file .write ("\n " )
269+ inputs_set = True
267270 elif node .bl_idname == 'NodeGroupOutput' :
268271 file .write (f"{ inner } #{ ng_name } outputs\n " )
269272 for output in node .inputs :
You can’t perform that action at this time.
0 commit comments