Skip to content

Commit

Permalink
sitne dorade
Browse files Browse the repository at this point in the history
  • Loading branch information
jovanmaks committed Dec 9, 2023
1 parent 4198295 commit 9f12081
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions nesting.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ class ExportCanvasAsPDFOperator(bpy.types.Operator):
subtype="FILE_PATH",
name="Save As",
description="Save canvas layout to PDF",
default="//canvas_layout.pdf"
default="canvas_layout.pdf"
)

def execute(self, context):
Expand Down Expand Up @@ -297,10 +297,15 @@ def execute(self, context):
self.report({'INFO'}, f"Canvas layout exported as PDF to {self.filepath}")
return {'FINISHED'}


def invoke(self, context, event):
context.window_manager.fileselect_add(self)
return {'RUNNING_MODAL'}
context.window_manager.fileselect_add(self)

# Check if the current filepath has a .pdf extension, if not, add it
if not self.filepath.lower().endswith(".pdf"):
self.filepath += ".pdf"

return {'RUNNING_MODAL'}



Expand Down

0 comments on commit 9f12081

Please sign in to comment.