From 48f4c9e387364255d2aa9b4c1412edcb17522814 Mon Sep 17 00:00:00 2001 From: furti Date: Wed, 12 Feb 2020 18:38:49 +0100 Subject: [PATCH] Fix attribute Name not found 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 --- texture_manager.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/texture_manager.py b/texture_manager.py index 1ffe8b3..afe45d2 100644 --- a/texture_manager.py +++ b/texture_manager.py @@ -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