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

@@ -72,7 +72,7 @@ ViewProviderShapeBinder::ViewProviderShapeBinder()
unsigned long shcol = hGrp->GetUnsigned("DefaultDatumColor", 0xFFD70099);
App::Color col((uint32_t)shcol);
ShapeColor.setValue(col);
ShapeAppearance.setDiffuseColor(col);
LineColor.setValue(col);
PointColor.setValue(col);
Transparency.setValue(60);
@@ -155,7 +155,7 @@ void ViewProviderShapeBinder::highlightReferences(bool on)
TopExp::MapShapes(static_cast<Part::Feature*>(obj)->Shape.getValue(), TopAbs_FACE, eMap);
originalFaceColors = svp->DiffuseColor.getValues();
std::vector<App::Color> fcolors = originalFaceColors;
fcolors.resize(eMap.Extent(), svp->ShapeColor.getValue());
fcolors.resize(eMap.Extent(), svp->ShapeAppearance.getDiffuseColor());
for (const std::string& e : subs) {
// Note: stoi may throw, but it strictly shouldn't happen
@@ -248,7 +248,7 @@ void ViewProviderSubShapeBinder::onChanged(const App::Property* prop) {
transparency = Gui::ViewParams::instance()->getDefaultShapeTransparency();
linewidth = Gui::ViewParams::instance()->getDefaultShapeLineWidth();
}
ShapeColor.setValue(shapeColor);
ShapeAppearance.setDiffuseColor(shapeColor);
LineColor.setValue(lineColor);
PointColor.setValue(pointColor);
Transparency.setValue(transparency);