From b9c8eb3b0c8caff1a593be2a6e7b1bca267aa4f5 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 22 Oct 2020 12:29:38 +1100 Subject: 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. --- source/blender/python/intern/bpy_app.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source') 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)); -- cgit v1.2.3