From 5b65e2dd7c73d2877ed0d5b789cc825fed39fd23 Mon Sep 17 00:00:00 2001 From: Jesse Yurkovich Date: Tue, 27 Feb 2024 07:46:29 +0100 Subject: [PATCH] Fix #118704: permit filepaths without extensions in STL batch mode The STL exporter was enforcing file paths with an extension when used from the file browser. This would cause oddness during Batch export mode and was different than the prior Python based exporter[1]. Permit the exporter to accept names without an extension as before. [1] [Prior python exporter](https://projects.blender.org/blender/blender-addons/src/branch/blender-v4.0-release/io_mesh_stl/__init__.py#L239) Pull Request: https://projects.blender.org/blender/blender/pulls/118777 --- source/blender/editors/io/io_stl_ops.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/blender/editors/io/io_stl_ops.cc b/source/blender/editors/io/io_stl_ops.cc index e4ab32183b7..dbb90599958 100644 --- a/source/blender/editors/io/io_stl_ops.cc +++ b/source/blender/editors/io/io_stl_ops.cc @@ -113,9 +113,12 @@ static bool wm_stl_export_check(bContext * /*C*/, wmOperator *op) { char filepath[FILE_MAX]; bool changed = false; + bool use_batch = RNA_boolean_get(op->ptr, "use_batch"); RNA_string_get(op->ptr, "filepath", filepath); - if (!BLI_path_extension_check(filepath, ".stl")) { + /* Enforce an extension on the filepath unless Batch mode is used. Batch mode + * will perform substitutions, including the extension, during its processing. */ + if (!use_batch && !BLI_path_extension_check(filepath, ".stl")) { BLI_path_extension_ensure(filepath, FILE_MAX, ".stl"); RNA_string_set(op->ptr, "filepath", filepath); changed = true;