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>2015-03-12 12:21:45 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2015-03-12 12:21:45 +0300
commitc840ce418476ace6d86fcf7751f309c026ff49d2 (patch)
tree97c4295d0b76f080e83b782cfdd95d14c25e20a7 /io_scene_fbx/export_fbx_bin.py
parent3fc5b82c6bdba2f9c954fbf497621b9bb794a1bc (diff)
Fix T43929: Exporting a mesh with shape keys as FBX with smoothing, creates invalid file.
Stupid libfbx crashes when there is no normals in 'main' mesh data, and some shape keys linked to that mesh. Now, issue is, I removed always writing normals because iirc this was giving bugs with some importers... Re-enabled it for now, let's hope everything works OK. *do not backport this* to 2.74!
Diffstat (limited to 'io_scene_fbx/export_fbx_bin.py')
-rw-r--r--io_scene_fbx/export_fbx_bin.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/io_scene_fbx/export_fbx_bin.py b/io_scene_fbx/export_fbx_bin.py
index 8686bbc0..d17d7145 100644
--- a/io_scene_fbx/export_fbx_bin.py
+++ b/io_scene_fbx/export_fbx_bin.py
@@ -738,6 +738,8 @@ def fbx_data_mesh_shapes_elements(root, me_obj, me, scene_data, fbx_me_tmpl, fbx
if me not in scene_data.data_deformers_shape:
return
+ write_normals = True # scene_data.settings.mesh_smooth_type in {'OFF'}
+
# First, write the geometry data itself (i.e. shapes).
_me_key, shape_key, shapes = scene_data.data_deformers_shape[me]
@@ -768,7 +770,8 @@ def fbx_data_mesh_shapes_elements(root, me_obj, me, scene_data, fbx_me_tmpl, fbx
elem_data_single_int32_array(geom, b"Indexes", shape_verts_idx)
elem_data_single_float64_array(geom, b"Vertices", shape_verts_co)
- elem_data_single_float64_array(geom, b"Normals", [0.0] * len(shape_verts_co))
+ if write_normals:
+ elem_data_single_float64_array(geom, b"Normals", [0.0] * len(shape_verts_co))
# Yiha! BindPose for shapekeys too! Dodecasigh...
# XXX Not sure yet whether several bindposes on same mesh are allowed, or not... :/
@@ -813,7 +816,7 @@ def fbx_data_mesh_elements(root, me_obj, scene_data, done_meshes):
# No gscale/gmat here, all data are supposed to be in object space.
smooth_type = scene_data.settings.mesh_smooth_type
- write_normals = smooth_type in {'OFF'}
+ write_normals = True # smooth_type in {'OFF'}
do_bake_space_transform = me_obj.use_bake_space_transform(scene_data)