Skip to content

Commit 553d7b6

Browse files
committed
feat: added default attribute names and attribute domains to outputs
1 parent 18c6560 commit 553d7b6

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

node_to_python.py

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,15 +303,30 @@ def process_node_group(node_group, level):
303303
#description
304304
if socket.description != "":
305305
file.write((f"{inner}{ng_name}"
306-
f".inputs[{i}]"
306+
f".outputs[{i}]"
307307
f".description = "
308308
f"\"{socket.description}\"\n"))
309309
#hide value
310310
if socket.hide_value is True:
311311
file.write((f"{inner}{ng_name}"
312-
f".inputs[{i}]"
312+
f".outputs[{i}]"
313313
f".hide_value = "
314314
f"{socket.hide_value}\n"))
315+
316+
#default attribute name
317+
if hasattr(socket, "default_attribute_name"):
318+
if socket.default_attribute_name != "":
319+
file.write((f"{inner}{ng_name}"
320+
f".outputs[{i}]"
321+
f".default_attribute_name = \""
322+
f"{socket.default_attribute_name}"
323+
f"\"\n"))
324+
#attribute domain
325+
if hasattr(socket, "attribute_domain"):
326+
file.write((f"{inner}{ng_name}"
327+
f".outputs[{i}]"
328+
f".attribute_domain = "
329+
f"\'{socket.attribute_domain}\'\n"))
315330

316331
file.write("\n")
317332
outputs_set = True

0 commit comments

Comments
 (0)