We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7c2b824 commit 2c55da4Copy full SHA for 2c55da4
node_to_python.py
@@ -141,11 +141,17 @@ class NodeToPython(bpy.types.Operator):
141
node_group_name: bpy.props.StringProperty(name="Node Group")
142
143
def execute(self, context):
144
+ if self.node_group_name not in bpy.data.node_groups:
145
+ return {'FINISHED'}
146
ng = bpy.data.node_groups[self.node_group_name]
147
ng_name = ng.name.lower().replace(' ', '_')
148
class_name = ng.name.replace(" ", "")
149
dir = bpy.path.abspath("//")
-
150
+ if not dir:
151
+ self.report({'ERROR'},
152
+ ("NodeToPython: Save your blend file before using "
153
+ "NodeToPython!"))
154
+ return {'CANCELLED'}
155
file = open(f"{dir}{ng_name}_addon.py", "w")
156
157
"""Sets up bl_info and imports Blender"""
0 commit comments