[Bf-blender-cvs] [b9c8eb3b0c8] master: PyAPI: expose the file version via bpy.app.version_file

Campbell Barton noreply at git.blender.org
Thu Oct 22 03:30:39 CEST 2020


Commit: b9c8eb3b0c8caff1a593be2a6e7b1bca267aa4f5
Author: Campbell Barton
Date:   Thu Oct 22 12:29:38 2020 +1100
Branches: master
https://developer.blender.org/rBb9c8eb3b0c8caff1a593be2a6e7b1bca267aa4f5

PyAPI: expose the file version via bpy.app.version_file

This exposes the version saved to the file,
compatible with `bpy.data.version`.

This is needed to write out version information into key-maps.

===================================================================

M	source/blender/python/intern/bpy_app.c

===================================================================

diff --git a/source/blender/python/intern/bpy_app.c b/source/blender/python/intern/bpy_app.c
index 554ab2645a7..a580b4f10f0 100644
--- a/source/blender/python/intern/bpy_app.c
+++ b/source/blender/python/intern/bpy_app.c
@@ -82,6 +82,7 @@ static PyTypeObject BlenderAppType;
 
 static PyStructSequence_Field app_info_fields[] = {
     {"version", "The Blender version as a tuple of 3 numbers. eg. (2, 83, 1)"},
+    {"version_file", "The blend file version, compatible with ``bpy.data.version``"},
     {"version_string", "The Blender version formatted as a string"},
     {"version_cycle", "The release status of this build alpha/beta/rc/release"},
     {"version_char", "Deprecated, always an empty string"},
@@ -151,6 +152,8 @@ static PyObject *make_app_info(void)
 
   SetObjItem(
       PyC_Tuple_Pack_I32(BLENDER_VERSION / 100, BLENDER_VERSION % 100, BLENDER_VERSION_PATCH));
+  SetObjItem(PyC_Tuple_Pack_I32(
+      BLENDER_FILE_VERSION / 100, BLENDER_FILE_VERSION % 100, BLENDER_FILE_SUBVERSION));
   SetStrItem(BKE_blender_version_string());
 
   SetStrItem(STRINGIFY(BLENDER_VERSION_CYCLE));



More information about the Bf-blender-cvs mailing list