@@ -157,24 +157,20 @@ void Obj::buildObjFromNavp(bool alsoLoadIntoUi) {
157157}
158158
159159void Obj::buildObj () {
160- Settings &settings = Settings::getInstance ();
161- Scene &scene = Scene::getInstance ();
160+ const Settings &settings = Settings::getInstance ();
161+ const Scene &scene = Scene::getInstance ();
162162 objLoaded = false ;
163163 Menu::updateMenuState ();
164164 startedObjGeneration = true ;
165- Logger::log (NK_INFO, " Generating obj from nav.json file." );
165+ std::string buildOutputFileType = blendFileOnlyExtract ? " blend" : " obj" ;
166+ Logger::log (NK_INFO, " Generating %s from nav.json file." , buildOutputFileType.c_str ());
166167 std::string command = " \" " ;
167168 command += settings.blenderPath ;
168169 command += " \" -b --factory-startup -P glacier2obj.py -- \" " ; // --debug-all
169170 command += scene.lastLoadSceneFile ;
170171 command += " \" \" " ;
171172 command += settings.outputFolder ;
172- if (!blendFileOnlyExtract) {
173- command += " \\ output.obj\" " ;
174- }
175- else {
176- command += " \\ output.blend\" " ;
177- }
173+ command += " \\ output." + buildOutputFileType + " \" " ;
178174 if (meshTypeForBuild == ALOC) {
179175 command += " ALOC " ;
180176 } else {
@@ -190,8 +186,8 @@ void Obj::buildObj() {
190186 generatedObjName = " output.obj" ;
191187
192188 backgroundWorker.emplace (
193- &CommandRunner::runCommand, CommandRunner::getInstance (), command, " Glacier2ObjBlender.log" , [this ] {
194- Logger::log (NK_INFO, " Finished generating obj from nav.json file." );
189+ &CommandRunner::runCommand, CommandRunner::getInstance (), command, " Glacier2ObjBlender.log" , [this , buildOutputFileType ] {
190+ Logger::log (NK_INFO, " Finished generating %s from nav.json file." , buildOutputFileType. c_str () );
195191 blenderObjGenerationDone = true ;
196192 }, [this ] {
197193 errorBuilding = true ;
0 commit comments