From 06b81a33ee7556de121cdc796c1e862fede523e0 Mon Sep 17 00:00:00 2001 From: Fmstrat Date: Fri, 14 Jan 2022 16:15:03 -0500 Subject: [PATCH] Fix when texture name doesn't exist or when material is blank string. --- texture_manager.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/texture_manager.py b/texture_manager.py index 1ffe8b3..90d3324 100644 --- a/texture_manager.py +++ b/texture_manager.py @@ -196,7 +196,10 @@ def isTexturable(self, o): if not hasattr(o, 'Shape') or o.Shape is None or o.Shape.isNull(): return False - if not hasattr(o, 'Material') or o.Material is None: + if not hasattr(o, 'Material') or o.Material is None or o.Material == '': + return False + + if not hasattr(o.Material, 'Name') or o.Material.Name is None or o.Material.Name == '': return False return o.ViewObject.Visibility