Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'NoneType' object has no attribute 'name' when object has blank Material #47

Open
ansonl opened this issue Jun 18, 2023 · 0 comments

Comments

@ansonl
Copy link
Contributor

ansonl commented Jun 18, 2023

Hi, sometimes when I try to export objects, I get the below exception.

Traceback (most recent call last):
  File "C:\Users\ansonl\AppData\Roaming\Blender Foundation\Blender\2.90\scripts\addons\io_mesh_3mf\export_3mf.py", line 116, in execute
    self.material_name_to_index = self.write_materials(resources_element, blender_objects)
  File "C:\Users\ansonl\AppData\Roaming\Blender Foundation\Blender\2.90\scripts\addons\io_mesh_3mf\export_3mf.py", line 221, in write_materials
    material_name = material.name
AttributeError: 'NoneType' object has no attribute 'name'

location: <unknown location>:-1

It happens when one of the objects had a Material created and assigned to it and then the material was deleted in the material menu with the X button next the material.

image

This leaves a blank material entry in the materials list for the object. This seems to be fixed by deleting the empty material with the "-" button in the list, but it would be nice if the 3MF addon did not error on this.

I tried importing the current master branch of the addon into Blender with the same error results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant