diff --git a/src/Mod/Part/Gui/ViewProviderMirror.cpp b/src/Mod/Part/Gui/ViewProviderMirror.cpp index 31368f4394..63180da2c1 100644 --- a/src/Mod/Part/Gui/ViewProviderMirror.cpp +++ b/src/Mod/Part/Gui/ViewProviderMirror.cpp @@ -266,6 +266,12 @@ void ViewProviderFillet::updateData(const App::Property* prop) applyColor(hist[0], colBase, colFill); } + // If the view provider has set a transparency then override the values + // of the input shapes + if (Transparency.getValue() > 0) { + applyTransparency(Transparency.getValue(), colFill); + } + this->DiffuseColor.setValues(colFill); } } @@ -357,21 +363,29 @@ void ViewProviderChamfer::updateData(const App::Property* prop) TopExp::MapShapes(baseShape, TopAbs_FACE, baseMap); TopExp::MapShapes(chamShape, TopAbs_FACE, chamMap); - Gui::ViewProvider* vpBase = Gui::Application::Instance->getViewProvider(objBase); - std::vector colBase = static_cast(vpBase)->DiffuseColor.getValues(); - std::vector colCham; - colCham.resize(chamMap.Extent(), static_cast(vpBase)->ShapeColor.getValue()); - applyTransparency(static_cast(vpBase)->Transparency.getValue(),colBase); + auto vpBase = dynamic_cast(Gui::Application::Instance->getViewProvider(objBase)); + if (vpBase) { + std::vector colBase = static_cast(vpBase)->DiffuseColor.getValues(); + std::vector colCham; + colCham.resize(chamMap.Extent(), static_cast(vpBase)->ShapeColor.getValue()); + applyTransparency(static_cast(vpBase)->Transparency.getValue(),colBase); - if (static_cast(colBase.size()) == baseMap.Extent()) { - applyColor(hist[0], colBase, colCham); - } - else if (!colBase.empty() && colBase[0] != this->ShapeColor.getValue()) { - colBase.resize(baseMap.Extent(), colBase[0]); - applyColor(hist[0], colBase, colCham); - } + if (static_cast(colBase.size()) == baseMap.Extent()) { + applyColor(hist[0], colBase, colCham); + } + else if (!colBase.empty() && colBase[0] != this->ShapeColor.getValue()) { + colBase.resize(baseMap.Extent(), colBase[0]); + applyColor(hist[0], colBase, colCham); + } - this->DiffuseColor.setValues(colCham); + // If the view provider has set a transparency then override the values + // of the input shapes + if (Transparency.getValue() > 0) { + applyTransparency(Transparency.getValue(), colCham); + } + + this->DiffuseColor.setValues(colCham); + } } } }