diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2017-10-31 18:28:33 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2018-01-01 18:29:47 +0300 |
commit | 213b0b5ff5d19468bf458915a6c78a406c97d619 (patch) | |
tree | 73329292d837512a2e5d5b4f6af3ab7639e1c8b7 | |
parent | 4e84d14771b6c32e156469fee965e6db07e0ea84 (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.
Conflicts:
io_scene_fbx/__init__.py
-rw-r--r-- | io_scene_fbx/export_fbx_bin.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/io_scene_fbx/export_fbx_bin.py b/io_scene_fbx/export_fbx_bin.py index 6c60a165..10f0e535 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") |