Materials: Child ignoring parent material
Inherit the material from the parent object when creating a new object, such as during a boolean operation, or when extruding a sketch. fixes #15503
This commit is contained in:
committed by
Yorik van Havre
parent
5435b3e4db
commit
0804d80ebf
@@ -247,23 +247,11 @@ void ViewProviderBody::updateData(const App::Property* prop)
|
||||
static_cast<PartDesignGui::ViewProvider*>(vp)->setTipIcon(feature == tip);
|
||||
}
|
||||
}
|
||||
|
||||
if (tip)
|
||||
copyColorsfromTip(tip);
|
||||
}
|
||||
|
||||
PartGui::ViewProviderPart::updateData(prop);
|
||||
}
|
||||
|
||||
void ViewProviderBody::copyColorsfromTip(App::DocumentObject* tip) {
|
||||
// update ShapeAppearance
|
||||
Gui::ViewProvider* vptip = Gui::Application::Instance->getViewProvider(tip);
|
||||
if (vptip && vptip->isDerivedFrom(PartGui::ViewProviderPartExt::getClassTypeId())) {
|
||||
auto materials = static_cast<PartGui::ViewProviderPartExt*>(vptip)->ShapeAppearance.getValues();
|
||||
this->ShapeAppearance.setValues(materials);
|
||||
}
|
||||
}
|
||||
|
||||
void ViewProviderBody::slotChangedObjectApp ( const App::DocumentObject& obj, const App::Property& prop ) {
|
||||
|
||||
if(App::GetApplication().isRestoring())
|
||||
|
||||
@@ -97,9 +97,6 @@ protected:
|
||||
/// Set Feature viewprovider into visual body mode
|
||||
void setVisualBodyMode(bool bodymode);
|
||||
|
||||
private:
|
||||
void copyColorsfromTip(App::DocumentObject* tip);
|
||||
|
||||
private:
|
||||
static const char* BodyModeEnum[];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user