Handle materials which don't have nodes

This commit is contained in:
Dion Moult
2019-09-17 11:20:22 +10:00
parent 611f0e7248
commit c21c9c24f8
+2 -1
View File
@@ -919,7 +919,8 @@ class IfcExporter():
return self.file.create_entity('IfcSurfaceStyleRendering', **rendering_attributes)
def get_rendering_attributes(self, material):
if 'Principled BSDF' not in material.node_tree.nodes:
if not hasattr(material.node_tree, 'nodes') \
or 'Principled BSDF' not in material.node_tree.nodes:
return {}
bsdf = material.node_tree.nodes['Principled BSDF']
return {