Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/io/io_gpencil_export.c
| Show First 20 Lines • Show All 73 Lines • ▼ Show 20 Lines | |||||
| static void set_export_filepath(bContext *C, wmOperator *op, const char *extension) | static void set_export_filepath(bContext *C, wmOperator *op, const char *extension) | ||||
| { | { | ||||
| if (!RNA_struct_property_is_set(op->ptr, "filepath")) { | if (!RNA_struct_property_is_set(op->ptr, "filepath")) { | ||||
| Main *bmain = CTX_data_main(C); | Main *bmain = CTX_data_main(C); | ||||
| char filepath[FILE_MAX]; | char filepath[FILE_MAX]; | ||||
| if (BKE_main_blendfile_path(bmain)[0] == '\0') { | if (BKE_main_blendfile_path(bmain)[0] == '\0') { | ||||
| BLI_strncpy(filepath, "untitled", sizeof(filepath)); | BLI_strncpy(filepath, DATA_("untitled"), sizeof(filepath)); | ||||
| } | } | ||||
| else { | else { | ||||
| BLI_strncpy(filepath, BKE_main_blendfile_path(bmain), sizeof(filepath)); | BLI_strncpy(filepath, BKE_main_blendfile_path(bmain), sizeof(filepath)); | ||||
| } | } | ||||
| BLI_path_extension_replace(filepath, sizeof(filepath), extension); | BLI_path_extension_replace(filepath, sizeof(filepath), extension); | ||||
| RNA_string_set(op->ptr, "filepath", filepath); | RNA_string_set(op->ptr, "filepath", filepath); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 323 Lines • Show Last 20 Lines | |||||