[Bf-blender-cvs] [9ac7946dd03] master: GPencil: Fix wrong file extension when exporting SVG

Antonio Vazquez noreply at git.blender.org
Wed Mar 24 18:47:38 CET 2021


Commit: 9ac7946dd03fb75bab591c5ed0a742c00b80286b
Author: Antonio Vazquez
Date:   Wed Mar 24 18:46:36 2021 +0100
Branches: master
https://developer.blender.org/rB9ac7946dd03fb75bab591c5ed0a742c00b80286b

GPencil: Fix wrong file extension when exporting SVG

Due a code cleanup it was using .PDF all times.

===================================================================

M	source/blender/editors/io/io_gpencil_export.c

===================================================================

diff --git a/source/blender/editors/io/io_gpencil_export.c b/source/blender/editors/io/io_gpencil_export.c
index 6f1e503403b..98e30f51116 100644
--- a/source/blender/editors/io/io_gpencil_export.c
+++ b/source/blender/editors/io/io_gpencil_export.c
@@ -85,7 +85,7 @@ static void gpencil_export_common_props_definition(wmOperatorType *ot)
                   "Export strokes with constant thickness");
 }
 
-static void set_export_filepath(bContext *C, wmOperator *op)
+static void set_export_filepath(bContext *C, wmOperator *op, const char *extension)
 {
   if (!RNA_struct_property_is_set(op->ptr, "filepath")) {
     Main *bmain = CTX_data_main(C);
@@ -98,7 +98,7 @@ static void set_export_filepath(bContext *C, wmOperator *op)
       BLI_strncpy(filepath, BKE_main_blendfile_path(bmain), sizeof(filepath));
     }
 
-    BLI_path_extension_replace(filepath, sizeof(filepath), ".pdf");
+    BLI_path_extension_replace(filepath, sizeof(filepath), extension);
     RNA_string_set(op->ptr, "filepath", filepath);
   }
 }
@@ -121,7 +121,7 @@ static bool wm_gpencil_export_svg_common_check(bContext *UNUSED(C), wmOperator *
 
 static int wm_gpencil_export_svg_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
 {
-  set_export_filepath(C, op);
+  set_export_filepath(C, op, ".svg");
 
   WM_event_add_fileselect(C, op);
 
@@ -280,7 +280,7 @@ static bool wm_gpencil_export_pdf_common_check(bContext *UNUSED(C), wmOperator *
 
 static int wm_gpencil_export_pdf_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
 {
-  set_export_filepath(C, op);
+  set_export_filepath(C, op, ".pdf");
 
   WM_event_add_fileselect(C, op);



More information about the Bf-blender-cvs mailing list