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>2014-05-20 17:57:15 +0400
committerBastien Montagne <montagne29@wanadoo.fr>2014-05-20 18:00:06 +0400
commit0962e658947844d22a9ad4dc929f7792e56ee284 (patch)
treeb726b48b0c1b5576a6257771f45e5342d93308d4
parent8fc745907e6b1035171423302190aff97e4a585d (diff)
Fix T40274: FBX Export: Group instances export a "No Material" material
-rw-r--r--io_scene_fbx/export_fbx_bin.py19
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