Skip to content

Commit

Permalink
Fixes an issue where the program would lock the .blend file whilst ru…
Browse files Browse the repository at this point in the history
…nning, essentially preventing Blender from saving the file
  • Loading branch information
ItsCubeTime authored Jun 23, 2021
1 parent 26bc7aa commit 1b7d1e4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ int prepare()
if (settingsFile.is_open())
{
settingsFile >> jsonSettings;
settingsFile.close();
} else
{
cout << "\nCannot open the settings.json file! \nClose all text editors and any potential other instances of this software and try again\n";
Expand Down Expand Up @@ -220,6 +221,7 @@ int startedWithFile(string filePath)
blendFile.open(filePath);
char textFromBlendFile[] = ".................";
blendFile >> textFromBlendFile; // All the dots will now have been replaced by the first characters in the file documment provided by our text based path
blendFile.close();

startBlenderVersionBasedOn_textFromBlendFile:
string textFromBlendFileStringVersion = textFromBlendFile;
Expand Down Expand Up @@ -315,6 +317,7 @@ int open(string pathToBlenderDirExcludingExecutableFileName, string pathToBlendF
pathToBlenderDirExcludingExecutableFileName.push_back('/');
}
// string systemCmdToExecute = "powershell -Command ''& \"" + pathToBlenderDirIncludingExecutableFileName + "blender.exe" + "\" \"" + pathToBlendFileIncludingFileNameAndExtension + "\" ''";
// string systemCmdToExecute = "\"start \"" + pathToBlenderDirExcludingExecutableFileName + "blender.exe\" " + "\"" + pathToBlenderDirExcludingExecutableFileName + "blender.exe" + "\" ^\"" + pathToBlendFileIncludingFileNameAndExtension + "^\"\"\"";
string systemCmdToExecute = "\"\"" + pathToBlenderDirExcludingExecutableFileName + "blender.exe" + "\" \"" + pathToBlendFileIncludingFileNameAndExtension + "\"\"";

cout << "\nSystemCmdToExecute:\n " << systemCmdToExecute.c_str()<<endl;
Expand Down Expand Up @@ -401,7 +404,7 @@ int main(int argc, char *argv[])
std::cout << "\nStarted with file\n";
startedWithFile(openedBlendFilePath);
}
system("pause");
// system("pause");
//code code code
return 0;
}

0 comments on commit 1b7d1e4

Please sign in to comment.