Skip to content

Commit

Permalink
Fix attribute Name not found
Browse files Browse the repository at this point in the history
In case, a object has a Material property, and the material has no "Name"
attribute, a exception is raised when texturing it. To prevent this from
happening, we check if the material has a Name. If not, we simply ignore
the object and do not texture it.

fixes #36
  • Loading branch information
furti committed Feb 12, 2020
1 parent 771c2ca commit 48f4c9e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions texture_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,11 @@ def isTexturable(self, o):

if not hasattr(o, 'Material') or o.Material is None:
return False

material = o.Material

if not hasattr(material, 'Name') or material.Name is None:
return False

return o.ViewObject.Visibility

Expand Down

0 comments on commit 48f4c9e

Please sign in to comment.