GPencil: Fix wrong file extension when exporting SVG

Due a code cleanup it was using .PDF all times.
This commit is contained in:
Antonio Vazquez 2021-03-24 18:46:36 +01:00
parent 43c48965d7
commit 9ac7946dd0
Notes: blender-bot 2023-02-14 06:21:59 +01:00
Referenced by issue #87091, "Mark Asset" meshobject with Softbody causes Blender to crash
Referenced by issue #86944, Regression: artefacts in video between Keyframes in VSE
Referenced by issue #86917, Cycles ray visibility broken in viewport
1 changed files with 4 additions and 4 deletions

View File

@ -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);