Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2017-10-31 18:28:33 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2017-10-31 18:28:33 +0300
commitfde4fe14b77cb4c912e12f5a0454e7afb1c90378 (patch)
tree001c9a768b28e53f672bfb8d984be09120f717ae /io_scene_fbx
parent0b286650b3e9913196bd16874c4840165392803d (diff)
Add option to control FBX 'empty' type through a string custom property in Blender's empty.
Based on https://developer.blender.org/D2279 by Pavel Křupala (@pavelkrupala), thanks.
Diffstat (limited to 'io_scene_fbx')
-rw-r--r--io_scene_fbx/__init__.py2
-rw-r--r--io_scene_fbx/export_fbx_bin.py5
2 files changed, 4 insertions, 3 deletions
diff --git a/io_scene_fbx/__init__.py b/io_scene_fbx/__init__.py
index d07cccdd..055fe86e 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, 8, 2),
+ "version": (3, 8, 3),
"blender": (2, 79, 1),
"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 58f9f7c6..58bd4586 100644
--- a/io_scene_fbx/export_fbx_bin.py
+++ b/io_scene_fbx/export_fbx_bin.py
@@ -553,13 +553,14 @@ def fbx_data_element_custom_properties(props, bid):
def fbx_data_empty_elements(root, empty, scene_data):
"""
- Write the Empty data block.
+ Write the Empty data block (you can control its FBX datatype with the 'fbx_type' string custom property).
"""
empty_key = scene_data.data_empties[empty]
null = elem_data_single_int64(root, b"NodeAttribute", get_fbx_uuid_from_key(empty_key))
null.add_string(fbx_name_class(empty.name.encode(), b"NodeAttribute"))
- null.add_string(b"Null")
+ val = empty.bdata.get('fbx_type', None)
+ null.add_string(val.encode() if val and isinstance(val, str) else b"Null")
elem_data_single_string(null, b"TypeFlags", b"Null")