Draft: fix to clone's App::Part support

This commit is contained in:
Yorik van Havre
2017-09-21 10:11:47 -03:00
parent ee9afdc7b2
commit 6797965dd5

View File

@@ -5797,7 +5797,7 @@ class _Clone(_DraftObject):
if o.isDerivedFrom("Part::Feature"):
if not o.Shape.isNull():
sh = o.Shape.copy()
elif o.isDerivedFrom("App::Part"):
elif o.hasExtension("App::GeoFeatureGroupExtension"):
shps = []
for so in o.Group:
if so.isDerivedFrom("Part::Feature"):
@@ -5874,6 +5874,16 @@ class _ViewProviderClone:
c = (c[0],c[1],c[2],o.ViewObject.Transparency/100.0)
for f in o.Shape.Faces:
colors.append(c)
elif o.hasExtension("App::GeoFeatureGroupExtension"):
for so in vobj.Object.Group:
if so.isDerivedFrom("Part::Feature"):
if len(so.ViewObject.DiffuseColor) > 1:
colors.extend(so.ViewObject.DiffuseColor)
else:
c = so.ViewObject.ShapeColor
c = (c[0],c[1],c[2],so.ViewObject.Transparency/100.0)
for f in so.Shape.Faces:
colors.append(c)
if colors:
vobj.DiffuseColor = colors