Material: Material appearance

Uses new material system for appearance

Each feature object now has a property called ShapeMaterial that
describes its physical properties. If it has a shape, it has a
material.

The ShapeColor attribute is replaced by a ShapeAppearance attribute.
This is a material list that describes all appearance properties, not
just diffuse color. As a list in can be used for all elements of a
shape, such as edges and faces.

A new widget is provided to allow the user to select materials in a
consistent fashion. It can also launch the material editor with its
more advanced capabilities.
This commit is contained in:
David Carter
2024-03-17 18:37:56 -04:00
committed by Chris Hennes
parent 37c38acd19
commit ba20441935
121 changed files with 4682 additions and 1685 deletions

View File

@@ -562,10 +562,10 @@ void ImportXCAF::createShape(const TopoDS_Shape& shape, bool perface, bool setna
color.r = jt->second.Red();
color.g = jt->second.Green();
color.b = jt->second.Blue();
static_cast<PartGui::ViewProviderPart*>(vp)->ShapeColor.setValue(color);
static_cast<PartGui::ViewProviderPart*>(vp)->ShapeAppearance.setDiffuseColor(color);
}
partColor = static_cast<PartGui::ViewProviderPart*>(vp)->ShapeColor.getValue();
partColor = static_cast<PartGui::ViewProviderPart*>(vp)->ShapeAppearance.getDiffuseColor();
}
#endif

View File

@@ -41,7 +41,8 @@ void ExportOCAFGui::findColors(Part::Feature* part, std::vector<App::Color>& col
if (vp && vp->isDerivedFrom(PartGui::ViewProviderPartExt::getClassTypeId())) {
colors = static_cast<PartGui::ViewProviderPartExt*>(vp)->DiffuseColor.getValues();
if (colors.empty()) {
colors.push_back(static_cast<PartGui::ViewProviderPart*>(vp)->ShapeColor.getValue());
colors.push_back(
static_cast<PartGui::ViewProviderPart*>(vp)->ShapeAppearance.getDiffuseColor());
}
}
}

View File

@@ -50,7 +50,7 @@ void ImportOCAFGui::applyFaceColors(Part::Feature* part, const std::vector<App::
}
if (colors.size() == 1) {
vp->ShapeColor.setValue(colors.front());
vp->ShapeAppearance.setDiffuseColor(colors.front());
vp->Transparency.setValue(100 * colors.front().a);
}
else {

View File

@@ -72,7 +72,7 @@ void ImpExpDxfReadGui::ApplyGuiStyles(Part::Feature* object) const
App::Color color = ObjectColor(m_entityAttributes.m_Color);
view->LineColor.setValue(color);
view->PointColor.setValue(color);
view->ShapeColor.setValue(color);
view->ShapeAppearance.setDiffuseColor(color);
view->DrawStyle.setValue(GetDrawStyle());
view->Transparency.setValue(0);
}