Merge pull request #4548 from chennes/lgtmDraftColorArrayCreation

[Draft] Eliminate unused loop iteration variables
This commit is contained in:
Yorik van Havre
2021-03-30 13:00:45 +02:00
committed by GitHub
2 changed files with 3 additions and 7 deletions

View File

@@ -60,8 +60,7 @@ class ViewProviderDraftArray(ViewProviderDraft):
else:
c = vobj.Object.Base.ViewObject.ShapeColor
c = (c[0],c[1],c[2],vobj.Object.Base.ViewObject.Transparency/100.0)
for f in vobj.Object.Base.Shape.Faces:
colors.append(c)
colors += [c] * len(vobj.Object.Base.Shape.Faces)
if colors:
n = 1
if hasattr(vobj.Object,"ArrayType"):

View File

@@ -61,9 +61,7 @@ class ViewProviderClone:
else:
c = o.ViewObject.ShapeColor
c = (c[0],c[1],c[2],o.ViewObject.Transparency/100.0)
for f in o.Shape.Faces: # TODO: verify this line
colors.append(c)
colors += [c] * len(o.Shape.Faces) # TODO: verify this line
elif o.hasExtension("App::GeoFeatureGroupExtension"):
for so in vobj.Object.Group:
if so.isDerivedFrom("Part::Feature"):
@@ -72,8 +70,7 @@ class ViewProviderClone:
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)
colors += [c] * len(so.Shape.Faces)
if colors:
vobj.DiffuseColor = colors