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>2016-02-12 11:26:00 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2016-02-12 11:26:00 +0300
commitcf871d6a3027bad3b39b66abf71a5d08f7650db5 (patch)
treec9d5cf1ff0d1efb780bc6891acc05b1dc5d62aaf /io_scene_fbx/export_fbx_bin.py
parent6266b4139503bb614576f15ea4e90870ac5e597d (diff)
FBX exporter: add option to choose which type of FBX node to use as armature.
By default, Blender uses a 'Null' one (rouglhly equivalent to our Empty), but now user can also choose a 'Root' or even plain "LimbNode". This seems to be necessary to hack around some Unity bug (see T47325). WARNING: the 'LimbNode' option *does not* import back correctly in Blender. Use it in pure export-only cases.
Diffstat (limited to 'io_scene_fbx/export_fbx_bin.py')
-rw-r--r--io_scene_fbx/export_fbx_bin.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/io_scene_fbx/export_fbx_bin.py b/io_scene_fbx/export_fbx_bin.py
index d3aeee76..fc34ea31 100644
--- a/io_scene_fbx/export_fbx_bin.py
+++ b/io_scene_fbx/export_fbx_bin.py
@@ -1557,8 +1557,12 @@ def fbx_data_object_elements(root, ob_obj, scene_data):
if ob_obj.is_bone:
obj_type = b"LimbNode"
elif (ob_obj.type == 'ARMATURE'):
- #~ obj_type = b"Root"
- obj_type = b"Null"
+ if scene_data.settings.armature_nodetype == 'ROOT':
+ obj_type = b"Root"
+ elif scene_data.settings.armature_nodetype == 'LIMBNODE':
+ obj_type = b"LimbNode"
+ else: # Default, preferred option...
+ obj_type = b"Null"
elif (ob_obj.type in BLENDER_OBJECT_TYPES_MESHLIKE):
obj_type = b"Mesh"
elif (ob_obj.type == 'LAMP'):
@@ -2867,6 +2871,7 @@ def save_single(operator, scene, filepath="",
embed_textures=False,
use_custom_props=False,
bake_space_transform=False,
+ armature_nodetype='NULL',
**kwargs
):
@@ -2919,7 +2924,8 @@ def save_single(operator, scene, filepath="",
bake_space_transform, global_matrix_inv, global_matrix_inv_transposed,
context_objects, object_types, use_mesh_modifiers,
mesh_smooth_type, use_mesh_edges, use_tspace,
- use_armature_deform_only, add_leaf_bones, bone_correction_matrix, bone_correction_matrix_inv,
+ armature_nodetype, use_armature_deform_only,
+ add_leaf_bones, bone_correction_matrix, bone_correction_matrix_inv,
bake_anim, bake_anim_use_all_bones, bake_anim_use_nla_strips, bake_anim_use_all_actions,
bake_anim_step, bake_anim_simplify_factor, bake_anim_force_startend_keying,
False, media_settings, use_custom_props,