Merge pull request #53 from wood-galaxy/equipement-fix

Arch : Fix ViewProviderComponent if vobj have not DiffuseColor attribute
This commit is contained in:
Yorik van Havre 2015-09-25 15:23:55 -03:00
commit 6a93d1392d
2 changed files with 48 additions and 47 deletions

View File

@ -709,9 +709,10 @@ class ViewProviderComponent:
vobj.update()
elif prop == "ShapeColor":
# restore DiffuseColor after overridden by ShapeColor
if len(vobj.DiffuseColor) > 1:
d = vobj.DiffuseColor
vobj.DiffuseColor = d
if hasattr(vobj,"DiffuseColor"):
if len(vobj.DiffuseColor) > 1:
d = vobj.DiffuseColor
vobj.DiffuseColor = d
return
def attach(self,vobj):

View File

@ -235,9 +235,9 @@ class _Equipment(ArchComponent.Component):
"The Equipment object"
def __init__(self,obj):
ArchComponent.Component.__init__(self,obj)
obj.addProperty("Part::PropertyPartShape","TopView","Arch",translate("Arch","an optional 2D shape representing a top view of this equipment"))
obj.addProperty("Part::PropertyPartShape","FrontView","Arch",translate("Arch","an optional 2D shape representing a front view of this equipment"))
obj.addProperty("Part::PropertyPartShape","SideView","Arch",translate("Arch","an optional 2D shape representing a side view of this equipment"))
#obj.addProperty("Part::PropertyPartShape","TopView","Arch",translate("Arch","an optional 2D shape representing a top view of this equipment"))
#obj.addProperty("Part::PropertyPartShape","FrontView","Arch",translate("Arch","an optional 2D shape representing a front view of this equipment"))
#obj.addProperty("Part::PropertyPartShape","SideView","Arch",translate("Arch","an optional 2D shape representing a side view of this equipment"))
obj.addProperty("App::PropertyString","Model","Arch",translate("Arch","The model description of this equipment"))
obj.addProperty("App::PropertyString","Url","Arch",translate("Arch","The url of the product page of this equipment"))
self.Type = "Equipment"