diff options
author | Philipp Oeser <info@graphics-engineer.com> | 2022-05-11 17:49:37 +0300 |
---|---|---|
committer | Philipp Oeser <info@graphics-engineer.com> | 2022-05-11 17:49:37 +0300 |
commit | fa114cc4a087b4484263a62efc8314c13bfff85c (patch) | |
tree | 4927c002bcccaf18770001b04adbcaa4391a4328 /source | |
parent | a4382badb91cce4e2d419425a9a06385f0aeb7fd (diff) | |
parent | 06a7afb528d8bdbbed1c07abfadc83fc95682ec4 (diff) |
Merge branch 'blender-v3.2-release'
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/io/io_usd.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/source/blender/editors/io/io_usd.c b/source/blender/editors/io/io_usd.c index 97ca9b026ec..609230eefea 100644 --- a/source/blender/editors/io/io_usd.c +++ b/source/blender/editors/io/io_usd.c @@ -190,6 +190,20 @@ static void wm_usd_export_draw(bContext *UNUSED(C), wmOperator *op) uiItemR(box, ptr, "use_instancing", 0, NULL, ICON_NONE); } +static bool wm_usd_export_check(bContext *UNUSED(C), wmOperator *op) +{ + char filepath[FILE_MAX]; + RNA_string_get(op->ptr, "filepath", filepath); + + if (!BLI_path_extension_check_n(filepath, ".usd", ".usda", ".usdc", NULL)) { + BLI_path_extension_ensure(filepath, FILE_MAX, ".usdc"); + RNA_string_set(op->ptr, "filepath", filepath); + return true; + } + + return false; +} + void WM_OT_usd_export(struct wmOperatorType *ot) { ot->name = "Export USD"; @@ -200,6 +214,7 @@ void WM_OT_usd_export(struct wmOperatorType *ot) ot->exec = wm_usd_export_exec; ot->poll = WM_operator_winactive; ot->ui = wm_usd_export_draw; + ot->check = wm_usd_export_check; ot->flag = OPTYPE_REGISTER; /* No UNDO possible. */ |