1
$\begingroup$

I am working in a company where a dedicated 3D team uses Blender to create assets and backgrounds. For internal reasons, we are currently stuck with using Blender 2.93 in our pipeline, and we are planning to upgrade only when the next LTS release (Blender 3.3) comes out.

Meanwhile, there are some PCs on the floor that have different versions of Blender installed, from 2.83 to 3.1. So I would like to have a python code which would run every time we open a project file, check if the Blender version currently running is 2.93.x, and if not, it should either give an error and exit the file, or popup box that the user would have to acknowledge by clicking on some button (something similar to the Save / Don't Save dialog box we get while quitting an unsaved file)

What I have in mind :

Illustrated Example of Version Check Warning Dialog Box

Another required feature is to have the ability to block the saving of the current file, maybe with some error or warning popup. This is just because we are making a Asset Library using the new Asset Browser feature in Blender 3.1. As mentioned above, we cannot use the updated version directly in the project, but it will be used only for preview purposes. I do not want anyone to mistakenly open the Asset Library file in Blender 2.93, and save it over the 3.1 file, as it causes some compatibility issues. So combining two codes, one to check blender version, and other to block the saving option, will be a good safe guard for our purpose.

Thanks in advance!

$\endgroup$
5
  • $\begingroup$ What have you tried so far and what are you stuck on? $\endgroup$ Jun 2, 2022 at 17:19
  • $\begingroup$ Unfortunately, I haven't had the time to try much of it myself. But I have to present in front of my team tomorrow, and for now, I would at least like to know if something like this is even possible? If it's not possible I will scrap the idea, but if it is possible then I will tell them that this is the future plan. $\endgroup$
    – Adisage
    Jun 2, 2022 at 17:26
  • $\begingroup$ Though I did check the Operator.report() method But I couldn't get it to work for my purpose. Also, the Error message using this method can be easily missed or ignored. I need something that would have to be consciously acknowledged, if possible. $\endgroup$
    – Adisage
    Jun 2, 2022 at 17:36
  • 1
    $\begingroup$ It's trivial to check the version and run a popup. It's not so easy to inhibit writing out the blend file, but it might be possible. $\endgroup$ Jun 2, 2022 at 17:45
  • $\begingroup$ docs.blender.org/api/current/bpy.app.html#bpy.app.version $\endgroup$
    – Gorgious
    Jun 3, 2022 at 5:49

0

You must log in to answer this question.

Browse other questions tagged .