diff options
-rw-r--r-- | io_scene_fbx/export_fbx_bin.py | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/io_scene_fbx/export_fbx_bin.py b/io_scene_fbx/export_fbx_bin.py index 19965086..0ad46f85 100644 --- a/io_scene_fbx/export_fbx_bin.py +++ b/io_scene_fbx/export_fbx_bin.py @@ -2094,15 +2094,16 @@ def fbx_data_from_scene(scene, settings): for mat, (mat_key, ob_objs) in data_materials.items(): for ob_obj in ob_objs: connections.append((b"OO", get_fbx_uuid_from_key(mat_key), ob_obj.fbx_uuid, None)) - if ob_obj.is_object: - # Get index of this mat for this object. - # Mat indices for mesh faces are determined by their order in 'mat to ob' connections. - # Only mats for meshes currently... - if ob_obj.type not in BLENDER_OBJECT_TYPES_MESHLIKE: - continue - _mesh_key, me, _free = data_meshes[ob_obj.bdata] - idx = _objs_indices[ob_obj] = _objs_indices.get(ob_obj, -1) + 1 - mesh_mat_indices.setdefault(me, OrderedDict())[mat] = idx + # Get index of this mat for this object (or dupliobject). + # Mat indices for mesh faces are determined by their order in 'mat to ob' connections. + # Only mats for meshes currently... + # Note in case of dupliobjects a same me/mat idx will be generated several times... + # Should not be an issue in practice, and it's needed in case we export duplis but not the original! + if ob_obj.type not in BLENDER_OBJECT_TYPES_MESHLIKE: + continue + _mesh_key, me, _free = data_meshes[ob_obj.bdata] + idx = _objs_indices[ob_obj] = _objs_indices.get(ob_obj, -1) + 1 + mesh_mat_indices.setdefault(me, OrderedDict())[mat] = idx del _objs_indices # Textures |