FBX (binary) export gives massive amount of false error messages #45756

Closed
opened 2015-08-11 15:06:00 +02:00 by Olli Kallioinen · 11 comments

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',
	)
**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', ) ```

Changed status to: 'Open'

Changed status to: 'Open'

Added subscriber: @suikki

Added subscriber: @suikki

Added subscriber: @mont29

Added subscriber: @mont29

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

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 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.

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.
Member

Added subscriber: @Blendify

Added subscriber: @Blendify

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

export_test.zip

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 [export_test.zip](https://archive.blender.org/developer/F223509/export_test.zip)

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).

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).
Bastien Montagne self-assigned this 2015-08-12 12:52:47 +02:00

This issue was referenced by 94abe3b97f

This issue was referenced by 94abe3b97f5c0b1afaa084dc8918464d27689b88

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Sign in to join this conversation.
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender-addons#45756
No description provided.