Page MenuHome

FBX (binary) export gives massive amount of false error messages
Closed, ResolvedPublic

Description

System Information
Windows 8.1

Blender Version
Broken: Blender version: 2.75a c27589e 64bit

Short description of error
When exporting a bit more complex FBX scene from the command line (using the binary FBX exporter) blender gives massive amounts of error messages even though the export is successful.

The console is filled with thousands of lines of this one error message:
Error: Object does not have duplis

The binary FBX export is also slow compared to the ASCII FBX export (probably due to console not keeping up with all the text).

Exact steps for others to reproduce the error
I'm exporting from the command line with something like blender.exe my_scene.blender --background --python my_export_script.py where my_export_script.py is basically just a call to bpy.ops.export_scene.fbx()

#/usr/bin/python
import bpy 

bpy.ops.export_scene.fbx(
	filepath='test.fbx',
	use_mesh_modifiers=True,
	use_anim=True,
	use_anim_optimize=False,
	use_anim_action_all=False,
	use_default_take=True,
	path_mode='STRIP',
	batch_mode='OFF',
	)

Event Timeline

Olli Kallioinen (suikki) raised the priority of this task from to 90.
Olli Kallioinen (suikki) updated the task description. (Show Details)
Olli Kallioinen (suikki) edited a custom field.
Bastien Montagne (mont29) lowered the priority of this task from 90 to 30.Aug 11 2015, 3:22 PM

Please add a .blend file producing such errors, report is useless without it…

I did some digging and it seems that the error text is shown when dupli_list_create is called for objects that don't use duplis.

This fixed it for me around line 1162 in fbx_utils.py:

     # #### Duplis...
     def dupli_list_create(self, scene, settings='PREVIEW'):
-        if self._tag == 'OB':
-            # Sigh, why raise exception here? :/
-            try:
-                self.bdata.dupli_list_create(scene, settings)
-            except:
-                pass
+        if self._tag == 'OB' and self.bdata.dupli_type != 'NONE':
+            self.bdata.dupli_list_create(scene, settings)
 
     def dupli_list_clear(self):
-        if self._tag == 'OB':
+        if self._tag == 'OB' and self.bdata.dupli_type != 'NONE':
             self.bdata.dupli_list_clear()
 
     def get_dupli_list(self):
-        if self._tag == 'OB':
+        if self._tag == 'OB' and self.bdata.dupli_type != 'NONE':
             return (ObjectWrapper(dup) for dup in self.bdata.dupli_list)
         return ()
     dupli_list = property(get_dupli_list)

I'm not 100% sure if this actually works as I haven't been using duplis

I'll have to create a blend file later as I don't have time now, but I assume any blend file with normal non-dupli objects will do.

Added a simple test scene and python script.

To test:

  • Extract files and open command prompt in that folder.
  • Run c:\blender-2.75a-windows64\blender.exe test.blend --background --python export.py (replace path with your blender path)

Result:
Export is successful but for each object in the scene there are couple of "Error: Object does not have duplis" in the output

Bastien Montagne (mont29) raised the priority of this task from 30 to 50.Aug 12 2015, 12:52 PM

OK thanks… stupid Blender, with UI it fires an exception, and without it just prints out in console… Will fix (similar to yours, but using dedicated flag).