diff --git a/src/Mod/BIM/bimcommands/BimLayers.py b/src/Mod/BIM/bimcommands/BimLayers.py index 27dd6bbb66bd..d2ccc86afcea 100644 --- a/src/Mod/BIM/bimcommands/BimLayers.py +++ b/src/Mod/BIM/bimcommands/BimLayers.py @@ -269,12 +269,11 @@ def accept(self): # transparency transparency = self.model.item(row, 6).data(QtCore.Qt.DisplayRole) - if transparency: - if obj.ViewObject.Transparency != transparency: - if not changed: - FreeCAD.ActiveDocument.openTransaction("Layers change") - changed = True - obj.ViewObject.Transparency = transparency + if obj.ViewObject.Transparency != transparency: + if not changed: + FreeCAD.ActiveDocument.openTransaction("Layers change") + changed = True + obj.ViewObject.Transparency = transparency # line print color color = self.model.item(row, 7).data(QtCore.Qt.UserRole) diff --git a/src/Mod/Draft/draftguitools/gui_layers.py b/src/Mod/Draft/draftguitools/gui_layers.py index 0cab3f5a5911..48da636abf61 100644 --- a/src/Mod/Draft/draftguitools/gui_layers.py +++ b/src/Mod/Draft/draftguitools/gui_layers.py @@ -235,12 +235,11 @@ def accept(self): # transparency transparency = self.model.item(row,6).data(QtCore.Qt.DisplayRole) - if transparency: - if vobj.Transparency != transparency: - if not changed: - doc.openTransaction("Layers change") - changed = True - vobj.Transparency = transparency + if vobj.Transparency != transparency: + if not changed: + doc.openTransaction("Layers change") + changed = True + vobj.Transparency = transparency # line print color color = self.model.item(row,7).data(QtCore.Qt.UserRole)