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 2
2
"name" : "Node to Python" ,
3
3
"description" : "Convert Geometry Node Groups to a Python add-on" ,
4
4
"author" : "Brendan Parmer" ,
5
- "version" : (1 , 2 , 2 ),
5
+ "version" : (1 , 2 , 4 ),
6
6
"blender" : (3 , 0 , 0 ),
7
7
"location" : "Node" ,
8
8
"category" : "Node" ,
@@ -222,12 +222,14 @@ def process_node_group(node_group, level):
222
222
f"name = \" { node_group .name } \" )\n " ))
223
223
file .write ("\n " )
224
224
225
+ inputs_set = False
226
+
225
227
#initialize nodes
226
228
file .write (f"{ inner } #initialize { ng_name } nodes\n " )
227
229
for node in node_group .nodes :
228
230
if node .bl_idname == 'GeometryNodeGroup' :
229
231
process_node_group (node .node_tree , level + 1 )
230
- elif node .bl_idname == 'NodeGroupInput' :
232
+ elif node .bl_idname == 'NodeGroupInput' and not inputs_set :
231
233
file .write (f"{ inner } #{ ng_name } inputs\n " )
232
234
for i , input in enumerate (node .outputs ):
233
235
if input .bl_idname != "NodeSocketVirtual" :
@@ -264,6 +266,7 @@ def process_node_group(node_group, level):
264
266
f"{ socket .max_value } \n " ))
265
267
file .write ("\n " )
266
268
file .write ("\n " )
269
+ inputs_set = True
267
270
elif node .bl_idname == 'NodeGroupOutput' :
268
271
file .write (f"{ inner } #{ ng_name } outputs\n " )
269
272
for output in node .inputs :
You can’t perform that action at this time.
0 commit comments