FBX export fails when batch mode is set to 'Scene' and mesh objects contain modifiers. #85151

Open
opened 2021-01-28 13:48:57 +01:00 by Gavin Owers · 2 comments

System Information
Operating system: Windows-10-10.0.19041-SP0 64 Bits
Graphics card: GeForce GTX 1060 6GB/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 460.89

Blender Version
Broken: version: 2.91.2, branch: master, commit date: 2021-01-19 16:15, hash: blender/blender@5be9ef4177

Short description of error
There is a bug in the FBX exporter that prevents the 'Scene' Batch Mode from exporting scenes containing mesh objects with modifiers.

If a Blender file contains multiple scenes, and those scenes contain mesh objects with modifiers, and the user has not viewed those scenes yet (because the file was recently opened, for example), the export process will fail, and returns an error.

You can avoid this bug by loading each individual scene in the 3D Viewport before exporting, disabling Apply Modifiers in the export settings, or manually removing/applying all modifiers in the Blender file. However, none of these solutions are ideal.

I have experienced this bug on multiple computers using multiple versions of Blender since 2.80.

Exact steps for others to reproduce the error
Bug_SceneBatchExport.blend
I have attached a Blender file called Bug_SceneBatchExport.blend. It contains three scenes (Cube, Monkey, Sphere). Each scene contains one mesh object with a modifier.

  • Open the Blender file. (If you have already opened it and viewed all three scenes, close it and open it again. This bug only occurs if the other scenes have not been viewed yet).
  • In the main menu go to File > Export > FBX (.fbx)
  • In the export settings set Batch Mode to 'Scene'.
  • Click Export FBX.

The export should fail, and you will get the following error message in the python console:

Python: Traceback (most recent call last):
  File "C:\Program Files\Blender Foundation\Blender 2.91\2.91\scripts\addons\io_scene_fbx\__init__.py", line 636, in execute
    return export_fbx_bin.save(self, context, **keywords)
  File "C:\Program Files\Blender Foundation\Blender 2.91\2.91\scripts\addons\io_scene_fbx\export_fbx_bin.py", line 3274, in save
    save_single(operator, scene, scene.view_layers[0].depsgraph, filepath, **kwargs_batch)
  File "C:\Program Files\Blender Foundation\Blender 2.91\2.91\scripts\addons\io_scene_fbx\export_fbx_bin.py", line 3079, in save_single
    scene_data = fbx_data_from_scene(scene, depsgraph, settings)
  File "C:\Program Files\Blender Foundation\Blender 2.91\2.91\scripts\addons\io_scene_fbx\export_fbx_bin.py", line 2302, in fbx_data_from_scene
    ob_to_convert = ob.evaluated_get(depsgraph) if settings.use_mesh_modifiers else ob
TypeError: Object.evaluated_get(): error with argument 1, "depsgraph" -  Function.depsgraph does not support a 'None' assignment Depsgraph type

location: <unknown location>:-1

If the batch export was successful it should create three FBX files, one for each scene. Each FBX should contain the contents of its corresponding scene, including mesh objects with applied modifiers.

That is all. Thank you for your hard work.

**System Information** Operating system: Windows-10-10.0.19041-SP0 64 Bits Graphics card: GeForce GTX 1060 6GB/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 460.89 **Blender Version** Broken: version: 2.91.2, branch: master, commit date: 2021-01-19 16:15, hash: `blender/blender@5be9ef4177` **Short description of error** There is a bug in the FBX exporter that prevents the 'Scene' Batch Mode from exporting scenes containing mesh objects with modifiers. If a Blender file contains multiple scenes, and those scenes contain mesh objects with modifiers, and the user has not viewed those scenes yet (because the file was recently opened, for example), the export process will fail, and returns an error. You can avoid this bug by loading each individual scene in the 3D Viewport before exporting, disabling Apply Modifiers in the export settings, or manually removing/applying all modifiers in the Blender file. However, none of these solutions are ideal. I have experienced this bug on multiple computers using multiple versions of Blender since 2.80. **Exact steps for others to reproduce the error** [Bug_SceneBatchExport.blend](https://archive.blender.org/developer/F9602489/Bug_SceneBatchExport.blend) I have attached a Blender file called Bug_SceneBatchExport.blend. It contains three scenes (Cube, Monkey, Sphere). Each scene contains one mesh object with a modifier. - Open the Blender file. (If you have already opened it and viewed all three scenes, close it and open it again. This bug only occurs if the other scenes have not been viewed yet). - In the main menu go to File > Export > FBX (.fbx) - In the export settings set Batch Mode to 'Scene'. - Click Export FBX. # The export should fail, and you will get the following error message in the python console: ``` Python: Traceback (most recent call last): File "C:\Program Files\Blender Foundation\Blender 2.91\2.91\scripts\addons\io_scene_fbx\__init__.py", line 636, in execute return export_fbx_bin.save(self, context, **keywords) File "C:\Program Files\Blender Foundation\Blender 2.91\2.91\scripts\addons\io_scene_fbx\export_fbx_bin.py", line 3274, in save save_single(operator, scene, scene.view_layers[0].depsgraph, filepath, **kwargs_batch) File "C:\Program Files\Blender Foundation\Blender 2.91\2.91\scripts\addons\io_scene_fbx\export_fbx_bin.py", line 3079, in save_single scene_data = fbx_data_from_scene(scene, depsgraph, settings) File "C:\Program Files\Blender Foundation\Blender 2.91\2.91\scripts\addons\io_scene_fbx\export_fbx_bin.py", line 2302, in fbx_data_from_scene ob_to_convert = ob.evaluated_get(depsgraph) if settings.use_mesh_modifiers else ob TypeError: Object.evaluated_get(): error with argument 1, "depsgraph" - Function.depsgraph does not support a 'None' assignment Depsgraph type location: <unknown location>:-1 ``` If the batch export was successful it should create three FBX files, one for each scene. Each FBX should contain the contents of its corresponding scene, including mesh objects with applied modifiers. That is all. Thank you for your hard work.
Author

Added subscriber: @CollinearVertex

Added subscriber: @CollinearVertex
Member

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 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#85151
No description provided.