DXF: exporting object with empty material slot fails #95835

Open
opened 2022-02-17 14:18:39 +01:00 by slowburn · 10 comments

System Information
Operating system: Windows-10-10.0.19043-SP0 64 Bits
Graphics card: NVIDIA GeForce RTX 3060 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 497.09

Blender Version
Broken: version: 3.1.0 Beta, branch: master, commit date: 2022-02-12 01:56, hash: blender/blender@517afcc858

Addon Information
Name: Export Autocad DXF Format (.dxf) (2, 2, 3)
Author: Remigiusz Fiedler (AKA migius), Vaclav Klecanda

Short description of error
If an object has a material slot but no material assigned to it, then DXF export fails with an error message in system console:

Nothing exported. Error: 'NoneType' object has no attribute 'diffuse_color'

When exporting multiple objects, if at least one object has an empty material slot, whole export fails and no .dxf file is written.

Exact steps for others to reproduce the error

  • Open attached .blend file or
    • Open default Blender scene
    • Select the cube and go to Material Properties tab
    • Unlink the default material
  • Export as DXF
  • See console

DXF export bug.blend

**System Information** Operating system: Windows-10-10.0.19043-SP0 64 Bits Graphics card: NVIDIA GeForce RTX 3060 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 497.09 **Blender Version** Broken: version: 3.1.0 Beta, branch: master, commit date: 2022-02-12 01:56, hash: `blender/blender@517afcc858` **Addon Information** Name: Export Autocad DXF Format (.dxf) (2, 2, 3) Author: Remigiusz Fiedler (AKA migius), Vaclav Klecanda **Short description of error** If an object has a material slot but no material assigned to it, then DXF export fails with an error message in system console: ``` Nothing exported. Error: 'NoneType' object has no attribute 'diffuse_color' ``` When exporting multiple objects, if at least one object has an empty material slot, whole export fails and no .dxf file is written. **Exact steps for others to reproduce the error** - Open attached .blend file or - Open default Blender scene - Select the cube and go to Material Properties tab - Unlink the default material - Export as DXF - See console [DXF export bug.blend](https://archive.blender.org/developer/F12873088/DXF_export_bug.blend)
Author

Added subscriber: @slowburn

Added subscriber: @slowburn

#102478 was marked as duplicate of this issue

#102478 was marked as duplicate of this issue
Member

Added subscriber: @PratikPB2123

Added subscriber: @PratikPB2123
Member

Changed status from 'Needs Triage' to: 'Needs User Info'

Changed status from 'Needs Triage' to: 'Needs User Info'
Member

Thanks for the report. Can not reproduce on current master.
Can you provide broken .dxf file?

Thanks for the report. Can not reproduce on current master. Can you provide broken .dxf file?
Author

There is no broken .dxf file because this is an issue with exporting. If export fails, .dxf file is not created.
I can only provide .blend file that is set up in a way that causes the error.
DXF export bug.blend

There is no broken .dxf file because this is an issue with exporting. If export fails, .dxf file is not created. I can only provide .blend file that is set up in a way that causes the error. [DXF export bug.blend](https://archive.blender.org/developer/F12873088/DXF_export_bug.blend)

Added subscriber: @mano-wii

Added subscriber: @mano-wii

Changed status from 'Needs User Info' to: 'Confirmed'

Changed status from 'Needs User Info' to: 'Confirmed'

I can confirm.

I can confirm.
Member

Added subscriber: @Cmaton

Added subscriber: @Cmaton
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#95835
No description provided.