static void filepath_avi(char *string, RenderData *rd, bool preview, const char *suffix) { int sfra, efra; if (string == NULL) return; if (preview) { sfra = rd->psfra; efra = rd->pefra; } else { sfra = rd->sfra; efra = rd->efra; } strcpy(string, rd->pic); BLI_path_abs(string, BKE_main_blendfile_path_from_global()); BLI_make_existing_file(string); if (rd->scemode & R_EXTENSION) { if (!BLI_path_extension_check(string, ".avi")) { BLI_path_frame_range(string, sfra, efra, 4); strcat(string, ".avi"); } } else { if (BLI_path_frame_check_chars(string)) { BLI_path_frame_range(string, sfra, efra, 4); } } BLI_path_suffix(string, FILE_MAX, suffix, ""); }
static bool wm_alembic_export_check(bContext *UNUSED(C), wmOperator *op) { char filepath[FILE_MAX]; RNA_string_get(op->ptr, "filepath", filepath); if (!BLI_path_extension_check(filepath, ".abc")) { BLI_path_extension_ensure(filepath, FILE_MAX, ".abc"); RNA_string_set(op->ptr, "filepath", filepath); return true; } return false; }