Arch: lint bad indentation, superfluous formatting (#9310)

This commit is contained in:
luzpaz
2023-04-19 03:40:16 -04:00
committed by GitHub
parent c55cae44b9
commit fdca2d49f7
16 changed files with 84 additions and 89 deletions

View File

@@ -208,9 +208,9 @@ class Component(ArchIFC.IfcProduct):
if not "Material" in pl:
obj.addProperty("App::PropertyLink","Material","Component",QT_TRANSLATE_NOOP("App::Property","A material for this object"))
if "BaseMaterial" in pl:
obj.Material = obj.BaseMaterial
obj.removeProperty("BaseMaterial")
FreeCAD.Console.PrintMessage("Upgrading "+obj.Label+" BaseMaterial property to Material\n")
obj.Material = obj.BaseMaterial
obj.removeProperty("BaseMaterial")
FreeCAD.Console.PrintMessage("Upgrading "+obj.Label+" BaseMaterial property to Material\n")
if not "MoveBase" in pl:
obj.addProperty("App::PropertyBool","MoveBase","Component",QT_TRANSLATE_NOOP("App::Property","Specifies if moving this object moves its base instead"))
obj.MoveBase = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch").GetBool("MoveBase",False)
@@ -809,18 +809,18 @@ class Component(ArchIFC.IfcProduct):
if o.Shape:
if not o.Shape.isNull():
if o.Shape.Solids and base.Solids:
## TODO use Part.Shape() instead?
s = o.Shape.copy()
if placement:
# see https://forum.freecadweb.org/viewtopic.php?p=579754#p579754
s.Placement = placement.multiply(s.Placement)
try:
if len(base.Solids) > 1:
base = Part.makeCompound([sol.cut(s) for sol in base.Solids])
else:
base = base.cut(s)
except Part.OCCError:
print("Arch: unable to cut object ",o.Name, " from ", obj.Name)
## TODO use Part.Shape() instead?
s = o.Shape.copy()
if placement:
# see https://forum.freecadweb.org/viewtopic.php?p=579754#p579754
s.Placement = placement.multiply(s.Placement)
try:
if len(base.Solids) > 1:
base = Part.makeCompound([sol.cut(s) for sol in base.Solids])
else:
base = base.cut(s)
except Part.OCCError:
print("Arch: unable to cut object ",o.Name, " from ", obj.Name)
return base
def spread(self,obj,shape,placement=None):
@@ -1204,10 +1204,10 @@ class ViewProviderComponent:
if obj.ViewObject.ShapeColor != c:
obj.ViewObject.ShapeColor = c
if 'Transparency' in obj.Material.Material:
t = int(obj.Material.Material['Transparency'])
if obj.ViewObject:
if obj.ViewObject.Transparency != t:
obj.ViewObject.Transparency = t
t = int(obj.Material.Material['Transparency'])
if obj.ViewObject:
if obj.ViewObject.Transparency != t:
obj.ViewObject.Transparency = t
elif prop == "Shape":
if obj.Base:
if obj.Base.isDerivedFrom("Part::Compound"):