[Bf-extensions-cvs] [b20f84f] master: FBX export: Fix error with empty metarial slots!

Bastien Montagne noreply at git.blender.org
Fri May 23 19:39:59 CEST 2014


Commit: b20f84f6bd0c43f2ce2f4481558dfb92b2704ab8
Author: Bastien Montagne
Date:   Fri May 23 18:50:36 2014 +0200
https://developer.blender.org/rBAb20f84f6bd0c43f2ce2f4481558dfb92b2704ab8

FBX export: Fix error with empty metarial slots!

===================================================================

M	io_scene_fbx/export_fbx_bin.py

===================================================================

diff --git a/io_scene_fbx/export_fbx_bin.py b/io_scene_fbx/export_fbx_bin.py
index ba6e900..e6cec4f 100644
--- a/io_scene_fbx/export_fbx_bin.py
+++ b/io_scene_fbx/export_fbx_bin.py
@@ -1929,6 +1929,8 @@ def fbx_data_from_scene(scene, settings):
         # If obj is not a valid object for materials, wrapper will just return an empty tuple...
         for mat_s in ob_obj.material_slots:
             mat = mat_s.material
+            if mat is None:
+                continue  # Empty slots!
             # Note theoretically, FBX supports any kind of materials, even GLSL shaders etc.
             # However, I doubt anything else than Lambert/Phong is really portable!
             # We support any kind of 'surface' shader though, better to have some kind of default Lambert than nothing.



More information about the Bf-extensions-cvs mailing list