Arch: Allow to build Arch objects from Part Compounds - fixes #2095

Arch objects can now be based on a Part Compound and will take
its DiffuseColor property. Arch objects that are clones of
such objects will also copy that property.
This commit is contained in:
Yorik van Havre
2015-06-14 18:36:54 -03:00
parent d0d98b8775
commit d0cfe4b010
6 changed files with 34 additions and 8 deletions

View File

@@ -781,6 +781,7 @@ class _ViewProviderWindow(ArchComponent.ViewProviderComponent):
if obj.Shape:
if not obj.Shape.isNull():
self.colorize(obj)
ArchComponent.ViewProviderComponent.updateData(self,obj,prop)
def onChanged(self,vobj,prop):
if (prop == "DiffuseColor") and vobj.Object:
@@ -788,6 +789,7 @@ class _ViewProviderWindow(ArchComponent.ViewProviderComponent):
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):
taskd = _ArchWindowTaskPanel()
@@ -811,10 +813,8 @@ class _ViewProviderWindow(ArchComponent.ViewProviderComponent):
def colorize(self,obj):
"setting different part colors"
if hasattr(obj,"CloneOf"):
if obj.CloneOf:
obj.ViewObject.DiffuseColor = obj.CloneOf.ViewObject.DiffuseColor
return
if not obj.WindowParts:
return
solids = obj.Shape.copy().Solids
#print "Colorizing ", solids
colors = []