Blender Version Selector

Blender Version Selector

Blender version selector automatically picks the correct Blender version when you double-click a .blend file based on which version of Blender the file was last saved in!

Essentially this is useful for anyone that frequently use different versions of Blender on the same computer & for different projects. For my particular usecase I originally developed this as I use one Blender version for my Armory 3D projects and another more recent version for other projects as I tend to love using alpha/beta releases (of which Armory typically doesnt support).

If the version selector fails to find a version on your system that matches the version of which the blend file was last saved in, it will prompt you which version you wanna use instead :slight_smile:

For the time being its Windows only, though it might be relatively easy to port considering the entire application is under 300 lines of code.

Download

Demo video

You can set the video resolution to 1080p at the bottom right

4 Likes

I hope someone will find it useful <3

Your app is very usefull for me. Very good process.
May be someone could make the same for Linux, I hope…
Thks a lot. :wink:

1 Like

Interesting. The good and useful approach. Thanks

1 Like

Hi there! Im glad you find it useful :slight_smile:

I wrote the code in mind that it should run well on Linux as well or at least be ported with minimal effort. If youre lucky and feel like giving it a go. You could try installing Clang or GCC on your Linux machine and compiling my code using clang main.cpp. My gut tells me it might just work

I dont have Linux installed, so it would be a little more tedious on my end to do this however

1 Like

I will look if I can… I am on Linux Mint 20.2 LTS aka Ubuntu 20.04.2
I don’t know compiling on Linux.
Thks.

EDIT: I am trying now…I installed Clang 10. I will test
clang main.cpp

EDIT 2:

$ clang main.cpp
main.cpp:8:10: fatal error: 'windows.h' file not found
#include <windows.h>
         ^~~~~~~~~~~
1 error generated.

EDIT 2: found the solution but now:

$ clang main.cpp
main.cpp:38:10: fatal error: 'processthreadsapi.h' file not found
#include <processthreadsapi.h>
         ^~~~~~~~~~~~~~~~~~~~~
1 error generated.

EDIT 3 : I removed it but now have this traceback:

$ clang main.cpp
main.cpp:175:5: warning: expression result unused [-Wunused-value]
    versionSelectorExecutableFilePathExcludingExecutableFileName;
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:198:5: warning: expression result unused [-Wunused-value]
    settingsJsonFilePathIncludingFileName;
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:328:1: error: use of undeclared identifier 'strcpy_s'; did you mean 'strcpy'?
strcpy_s(textFromBlendFile, ".................");
^~~~~~~~
strcpy
/usr/include/string.h:122:14: note: 'strcpy' declared here
extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
             ^
2 warnings and 1 error generated.

AND now I can’t understand!!!

Oh, well then I guess it maybe isnt that straight forward :thinking:

$ clang main.cpp
main.cpp:175:5: warning: expression result unused [-Wunused-value]
versionSelectorExecutableFilePathExcludingExecutableFileName;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:198:5: warning: expression result unused [-Wunused-value]
settingsJsonFilePathIncludingFileName;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:328:1: error: use of undeclared identifier ‘strcpy_s’; did you mean ‘strcpy’?
strcpy_s(textFromBlendFile, “…”);
^~~~~~~~
strcpy
/usr/include/string.h:122:14: note: ‘strcpy’ declared here
extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
^
2 warnings and 1 error generated.

This one is strange. strcpy_s is a function defined in the library string.h, which we are including in the file. However the compiler is telling you that it cant find any “strcpy_s” despite of that.

I might setup a Linux virtual machine and give this a go relatively soon myself, but that last error is suggseting that you would replace strcpy_s with strcpy. But I dont think thats gonna work with the way I used the function so I cant really come up with any super quick solutions to that one

$ clang main.cpp
main.cpp:8:10: fatal error: ‘windows.h’ file not found
#include <windows.h>
^~~~~~~~~~~
1 error generated.

That “windows.h” include at the top is def not Linux compatible btw I just realized, it appears to be unused so like you probably already did, just remove the line.

Yes for windows.h I write this in the main.cpp file :

#ifdef _WIN32
#include <iostream>
#include <fstream>
#include <stdio.h>
#include <string>
#include <cstdio>
#include <map>
#include <vector>

#include <windows.h>
#include <shobjidl.h>
#include <tchar.h>
#endif

#ifdef linux
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>

#include <iostream>
#include <fstream>
#include <cstdio>
#include <map>
#include <vector>
#endif


#pragma comment(lib,"user32.lib")
#pragma comment(lib,"Comdlg32.lib")



#include "json.hpp"
#include <filesystem>

#ifdef _WIN32
#include <processthreadsapi.h>
#endif