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
d67bb37bc7
commit
e4bf988db2
@@ -471,6 +471,20 @@ void Body::onChanged(const App::Property* prop) {
|
||||
}
|
||||
|
||||
}
|
||||
else if (prop == &ShapeMaterial) {
|
||||
std::vector<App::DocumentObject*> features = Group.getValues();
|
||||
if (!features.empty()) {
|
||||
for (auto it : features) {
|
||||
auto feature = dynamic_cast<Part::Feature*>(it);
|
||||
if (feature) {
|
||||
if (feature->ShapeMaterial.getValue().getUUID()
|
||||
!= ShapeMaterial.getValue().getUUID()) {
|
||||
feature->ShapeMaterial.setValue(ShapeMaterial.getValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Part::BodyBase::onChanged(prop);
|
||||
|
||||
Reference in New Issue
Block a user