Skip to content

Commit

Permalink
Arch: Fixed bug in windows transparency
Browse files Browse the repository at this point in the history
  • Loading branch information
yorikvanhavre committed Mar 6, 2018
1 parent b325876 commit 124d0ef
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/Mod/Arch/ArchWindow.py
Expand Up @@ -1048,13 +1048,12 @@ def onDelete(self,vobj,subelements):
return True

def onChanged(self,vobj,prop):
if (prop == "DiffuseColor") and vobj.Object:
if (prop in ["DiffuseColor","ShapeColor","Transparency"]) and vobj.Object:
if vobj.Object.Base:
if not vobj.Object.Base.Shape.Solids:
if len(vobj.DiffuseColor) < 2:
if vobj.Object.Shape:
if not vobj.Object.Shape.isNull():
self.colorize(vobj.Object)
if len(vobj.DiffuseColor) < 2:
if vobj.Object.Shape:
if not vobj.Object.Shape.isNull():
self.colorize(vobj.Object)
ArchComponent.ViewProviderComponent.onChanged(self,vobj,prop)

def setEdit(self,vobj,mode):
Expand All @@ -1080,6 +1079,9 @@ def unsetEdit(self,vobj,mode):

def colorize(self,obj):
"setting different part colors"
if obj.CloneOf:
obj.ViewObject.DiffuseColor = obj.CloneOf.ViewObject.DiffuseColor
return
if not obj.WindowParts:
return
solids = obj.Shape.copy().Solids
Expand Down Expand Up @@ -1116,10 +1118,9 @@ def colorize(self,obj):
ccol = base
colors.extend([ccol for f in solids[i].Faces])
#print("colors: ",colors)
if colors:
if len(colors) > 1:
if colors != obj.ViewObject.DiffuseColor:
if obj.Material and (len(colors) > 1):
obj.ViewObject.DiffuseColor = colors
obj.ViewObject.DiffuseColor = colors

class _ArchWindowTaskPanel:
'''The TaskPanel for Arch Windows'''
Expand Down
2 changes: 2 additions & 0 deletions src/Mod/Draft/Draft.py
Expand Up @@ -2978,6 +2978,8 @@ def clone(obj,delta=None,forcedraft=False):
cl.Tag = base.Tag
except:
pass
if gui:
cl.ViewObject.DiffuseColor = base.ViewObject.DiffuseColor
select(cl)
return cl
else:
Expand Down

0 comments on commit 124d0ef

Please sign in to comment.