Arch: Make sure the BaseMaterial property contains a Material object

This commit is contained in:
Yorik van Havre
2016-12-29 20:42:30 -02:00
parent a0af969a47
commit 4284e437d3
5 changed files with 10 additions and 1 deletions

View File

@@ -346,7 +346,12 @@ class Component:
self.Type = state
def onChanged(self,obj,prop):
pass
if prop == "BaseMaterial":
if hasattr(obj,"BaseMaterial"):
if obj.BaseMaterial:
if Draft.getType(obj.BaseMaterial) != "Material":
obj.BaseMaterial = None
print "Removing bad BaseMaterial link in ",obj.Name
def clone(self,obj):
"if this object is a clone, sets the shape. Returns True if this is the case"