Skip to content

Commit 55cc874

Browse files
committed
fix: materials and objects no longer try to set default values
1 parent 0ae9383 commit 55cc874

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

node_to_python.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
}
1010

1111
import bpy
12+
import os
1213

1314
#node tree input sockets that have default properties
1415
default_sockets = {'NodeSocketBool',
@@ -26,7 +27,7 @@
2627
dont_set_defaults = {'NodeSocketCollection',
2728
'NodeSocketGeometry',
2829
'NodeSocketImage',
29-
'NodeSocketMaterial'
30+
'NodeSocketMaterial',
3031
'NodeSocketObject',
3132
'NodeSocketTexture',
3233
'NodeSocketVirtual'}
@@ -152,7 +153,10 @@ def execute(self, context):
152153
("NodeToPython: Save your blend file before using "
153154
"NodeToPython!"))
154155
return {'CANCELLED'}
155-
file = open(f"{dir}{ng_name}_addon.py", "w")
156+
addon_dir = os.path.join(dir, "addons")
157+
if not os.path.exists(addon_dir):
158+
os.mkdir(addon_dir)
159+
file = open(f"{addon_dir}/{ng_name}_addon.py", "w")
156160

157161
"""Sets up bl_info and imports Blender"""
158162
def header():

0 commit comments

Comments
 (0)