[Bf-extensions-cvs] [fd695c3] master: FBX IO: Better info in header about blender & addon versions used to generate the FBX file.
Bastien Montagne
noreply at git.blender.org
Fri Sep 19 14:51:49 CEST 2014
Commit: fd695c3a81b63db072311e8516e0dbb8d4474047
Author: Bastien Montagne
Date: Fri Sep 19 14:50:59 2014 +0200
Branches: master
https://developer.blender.org/rBAfd695c3a81b63db072311e8516e0dbb8d4474047
FBX IO: Better info in header about blender & addon versions used to generate the FBX file.
===================================================================
M io_scene_fbx/export_fbx_bin.py
M io_scene_fbx_experimental/export_fbx_bin.py
===================================================================
diff --git a/io_scene_fbx/export_fbx_bin.py b/io_scene_fbx/export_fbx_bin.py
index 361d7ff..38c72c4 100644
--- a/io_scene_fbx/export_fbx_bin.py
+++ b/io_scene_fbx/export_fbx_bin.py
@@ -2354,6 +2354,9 @@ def fbx_header_elements(root, scene_data, time=None):
Write boiling code of FBX root.
time is expected to be a datetime.datetime object, or None (using now() in this case).
"""
+ app_vendor = "Blender Foundation"
+ app_name = "Blender (stable FBX IO)"
+ app_ver = bpy.app.version_string
# ##### Start of FBXHeaderExtension element.
header_ext = elem_empty(root, b"FBXHeaderExtension")
@@ -2376,7 +2379,7 @@ 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", "Blender version %s" % bpy.app.version_string)
+ elem_data_single_string_unicode(header_ext, b"Creator", "%s - %s" % (app_name, app_ver))
# 'SceneInfo' seems mandatory to get a valid FBX file...
# TODO use real values!
@@ -2398,15 +2401,15 @@ def fbx_header_elements(root, scene_data, time=None):
elem_props_set(props, "p_string_url", b"DocumentUrl", "/foobar.fbx")
elem_props_set(props, "p_string_url", b"SrcDocumentUrl", "/foobar.fbx")
original = elem_props_compound(props, b"Original")
- original("p_string", b"ApplicationVendor", "Blender Foundation")
- original("p_string", b"ApplicationName", "Blender")
- original("p_string", b"ApplicationVersion", "2.70")
+ original("p_string", b"ApplicationVendor", app_vendor)
+ original("p_string", b"ApplicationName", app_name)
+ original("p_string", b"ApplicationVersion", app_ver)
original("p_datetime", b"DateTime_GMT", "01/01/1970 00:00:00.000")
original("p_string", b"FileName", "/foobar.fbx")
lastsaved = elem_props_compound(props, b"LastSaved")
- lastsaved("p_string", b"ApplicationVendor", "Blender Foundation")
- lastsaved("p_string", b"ApplicationName", "Blender")
- lastsaved("p_string", b"ApplicationVersion", "2.70")
+ lastsaved("p_string", b"ApplicationVendor", app_vendor)
+ lastsaved("p_string", b"ApplicationName", app_name)
+ lastsaved("p_string", b"ApplicationVersion", app_ver)
lastsaved("p_datetime", b"DateTime_GMT", "01/01/1970 00:00:00.000")
# ##### End of FBXHeaderExtension element.
@@ -2420,7 +2423,7 @@ 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", "Blender version %s" % bpy.app.version_string)
+ elem_data_single_string_unicode(root, b"Creator", "%s - %s" % (app_name, app_ver))
# ##### Start of GlobalSettings element.
global_settings = elem_empty(root, b"GlobalSettings")
diff --git a/io_scene_fbx_experimental/export_fbx_bin.py b/io_scene_fbx_experimental/export_fbx_bin.py
index 494f0a6..f52b47f 100644
--- a/io_scene_fbx_experimental/export_fbx_bin.py
+++ b/io_scene_fbx_experimental/export_fbx_bin.py
@@ -2456,6 +2456,9 @@ def fbx_header_elements(root, scene_data, time=None):
Write boiling code of FBX root.
time is expected to be a datetime.datetime object, or None (using now() in this case).
"""
+ app_vendor = "Blender Foundation"
+ app_name = "Blender (experimental FBX IO)"
+ app_ver = bpy.app.version_string
# ##### Start of FBXHeaderExtension element.
header_ext = elem_empty(root, b"FBXHeaderExtension")
@@ -2478,7 +2481,7 @@ 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", "Blender version %s" % bpy.app.version_string)
+ elem_data_single_string_unicode(header_ext, b"Creator", "%s - %s" % (app_name, app_ver))
# 'SceneInfo' seems mandatory to get a valid FBX file...
# TODO use real values!
@@ -2500,15 +2503,15 @@ def fbx_header_elements(root, scene_data, time=None):
elem_props_set(props, "p_string_url", b"DocumentUrl", "/foobar.fbx")
elem_props_set(props, "p_string_url", b"SrcDocumentUrl", "/foobar.fbx")
original = elem_props_compound(props, b"Original")
- original("p_string", b"ApplicationVendor", "Blender Foundation")
- original("p_string", b"ApplicationName", "Blender")
- original("p_string", b"ApplicationVersion", "2.70")
+ original("p_string", b"ApplicationVendor", app_vendor)
+ original("p_string", b"ApplicationName", app_name)
+ original("p_string", b"ApplicationVersion", app_ver)
original("p_datetime", b"DateTime_GMT", "01/01/1970 00:00:00.000")
original("p_string", b"FileName", "/foobar.fbx")
lastsaved = elem_props_compound(props, b"LastSaved")
- lastsaved("p_string", b"ApplicationVendor", "Blender Foundation")
- lastsaved("p_string", b"ApplicationName", "Blender")
- lastsaved("p_string", b"ApplicationVersion", "2.70")
+ lastsaved("p_string", b"ApplicationVendor", app_vendor)
+ lastsaved("p_string", b"ApplicationName", app_name)
+ lastsaved("p_string", b"ApplicationVersion", app_ver)
lastsaved("p_datetime", b"DateTime_GMT", "01/01/1970 00:00:00.000")
# ##### End of FBXHeaderExtension element.
@@ -2522,7 +2525,7 @@ 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", "Blender version %s" % bpy.app.version_string)
+ elem_data_single_string_unicode(root, b"Creator", "%s - %s" % (app_name, app_ver))
# ##### Start of GlobalSettings element.
global_settings = elem_empty(root, b"GlobalSettings")
More information about the Bf-extensions-cvs
mailing list