[Bf-extensions-cvs] [962d1d0] master: FBX Export: Write version of FBX addon too!

Bastien Montagne noreply at git.blender.org
Fri Aug 21 00:52:26 CEST 2015


Commit: 962d1d0e8c3905589da7b6866ec207b0bb3bb527
Author: Bastien Montagne
Date:   Thu Aug 20 20:43:08 2015 +0200
Branches: master
https://developer.blender.org/rBA962d1d0e8c3905589da7b6866ec207b0bb3bb527

FBX Export: Write version of FBX addon too!

Grrrr, could have sweared I had done that since ages...

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

M	io_scene_fbx/__init__.py
M	io_scene_fbx/export_fbx_bin.py

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

diff --git a/io_scene_fbx/__init__.py b/io_scene_fbx/__init__.py
index 61b5258..5be7392 100644
--- a/io_scene_fbx/__init__.py
+++ b/io_scene_fbx/__init__.py
@@ -21,7 +21,7 @@
 bl_info = {
     "name": "FBX format",
     "author": "Campbell Barton, Bastien Montagne, Jens Restemeier",
-    "version": (3, 5, 5),
+    "version": (3, 5, 6),
     "blender": (2, 74, 0),
     "location": "File > Import-Export",
     "description": "FBX IO meshes, UV's, vertex colors, materials, textures, cameras, lamps and actions",
diff --git a/io_scene_fbx/export_fbx_bin.py b/io_scene_fbx/export_fbx_bin.py
index 6e1fc6a..365e98e 100644
--- a/io_scene_fbx/export_fbx_bin.py
+++ b/io_scene_fbx/export_fbx_bin.py
@@ -2547,6 +2547,11 @@ def fbx_header_elements(root, scene_data, time=None):
     app_vendor = "Blender Foundation"
     app_name = "Blender (stable FBX IO)"
     app_ver = bpy.app.version_string
+
+    import addon_utils
+    import sys
+    addon_ver = addon_utils.module_bl_info(sys.modules[__package__])['version']
+
     # ##### Start of FBXHeaderExtension element.
     header_ext = elem_empty(root, b"FBXHeaderExtension")
 
@@ -2569,7 +2574,8 @@ def fbx_header_elements(root, scene_data, time=None):
     elem_data_single_int32(elem, b"Second", time.second)
     elem_data_single_int32(elem, b"Millisecond", time.microsecond // 1000)
 
-    elem_data_single_string_unicode(header_ext, b"Creator", "%s - %s" % (app_name, app_ver))
+    elem_data_single_string_unicode(header_ext, b"Creator", "%s - %s - %d.%d.%d"
+                                                % (app_name, app_ver, addon_ver[0], addon_ver[1], addon_ver[2]))
 
     # 'SceneInfo' seems mandatory to get a valid FBX file...
     # TODO use real values!
@@ -2613,7 +2619,8 @@ def fbx_header_elements(root, scene_data, time=None):
                                     "".format(time.year, time.month, time.day, time.hour, time.minute, time.second,
                                               time.microsecond * 1000))
 
-    elem_data_single_string_unicode(root, b"Creator", "%s - %s" % (app_name, app_ver))
+    elem_data_single_string_unicode(root, b"Creator", "%s - %s - %d.%d.%d"
+                                          % (app_name, app_ver, addon_ver[0], addon_ver[1], addon_ver[2]))
 
     # ##### Start of GlobalSettings element.
     global_settings = elem_empty(root, b"GlobalSettings")



More information about the Bf-extensions-cvs mailing list