diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2016-10-31 14:22:40 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2016-10-31 14:22:40 +0300 |
commit | 21700373aead71afb6108a190a2b94302e94b8d3 (patch) | |
tree | f4c106a544a5b7f78408c4528902fca712fe3f0b /io_scene_fbx/export_fbx_bin.py | |
parent | afde50f68185006e0b0d5d957b762e97cff6e61f (diff) |
Fix T49873: FBX exporter not handling correctly Object-assigned materials.
Note that FBX still links materials to geometry, so we have to export
own version of mesh in that case (i.e. Object-materials break instancing
if any).
Diffstat (limited to 'io_scene_fbx/export_fbx_bin.py')
-rw-r--r-- | io_scene_fbx/export_fbx_bin.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/io_scene_fbx/export_fbx_bin.py b/io_scene_fbx/export_fbx_bin.py index 250b9516..49e8e160 100644 --- a/io_scene_fbx/export_fbx_bin.py +++ b/io_scene_fbx/export_fbx_bin.py @@ -2172,12 +2172,14 @@ def fbx_data_from_scene(scene, settings): data_meshes[ob_obj] = data_meshes[org_ob_obj] continue - if settings.use_mesh_modifiers or ob.type in BLENDER_OTHER_OBJECT_TYPES: - use_org_data = False + is_ob_material = any(ms.link == 'OBJECT' for ms in ob.material_slots) + + if settings.use_mesh_modifiers or ob.type in BLENDER_OTHER_OBJECT_TYPES or is_ob_material: + # We cannot use default mesh in that case, or material would not be the right ones... + use_org_data = not is_ob_material tmp_mods = [] - if ob.type == 'MESH': + if use_org_data and ob.type == 'MESH': # No need to create a new mesh in this case, if no modifier is active! - use_org_data = True for mod in ob.modifiers: # For meshes, when armature export is enabled, disable Armature modifiers here! if mod.type == 'ARMATURE' and 'ARMATURE' in settings.object_types: |