How do I know before opening a .blend file which version it was created in?
Or is there metadata available I may access prior to attempting to open a .blend file?
I ask because I need to know which version of Blender I should supply as the path to open a .blend from a subprocess call:
allBlendFiles = glob.glob1(dest_directory, "*.blend") #get all .blends in a dir blendFile = allBlendFiles #for simplicity, just use the first .blend src_directory = os.path.join(dest_directory, blendFile)#abs path to the .blend LEGACY_MODE = blendFile.meta???.version < (2, 80, 0) #HOW CAN ACCESS VERSION OF .blend FILE? if LEGACY_MODE: #Path to Blender 2.79 blenderRuntimePath = r"C:\Program Files\Blender Foundation\Blender\blender.exe", else: #Path to Blender 2.8 blenderRuntimePath = r"C:\Program Files\Blender Foundation\Blender28\blender.exe", subprocess.check_call([ blenderRuntimePath, #THIS PATH CHANGES BASED ON THE VERSION OF .blend IT IS OPENING src_directory, r"--background", r"--python", r"C:\Projects\Automation\BuildCharacter.py" ])