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

@@ -50,7 +50,8 @@ ViewProviderOriginFeature::ViewProviderOriginFeature () {
ADD_PROPERTY_TYPE ( Size, (ViewProviderOrigin::defaultSize()), 0, App::Prop_ReadOnly,
QT_TRANSLATE_NOOP("App::Property", "Visual size of the feature"));
ShapeColor.setValue ( ViewProviderOrigin::defaultColor ); // Set default color for origin (light-blue)
ShapeAppearance.setDiffuseColor(
ViewProviderOrigin::defaultColor); // Set default color for origin (light-blue)
Transparency.setValue(0);
BoundingBox.setStatus(App::Property::Hidden, true); // Hide Boundingbox from the user due to it doesn't make sense
@@ -108,13 +109,13 @@ void ViewProviderOriginFeature::attach(App::DocumentObject* pcObject)
auto axisRoles = App::Origin::AxisRoles;
if ( strncmp(axisName, axisRoles[0], strlen(axisRoles[0]) ) == 0 ) {
// X-axis: red
ShapeColor.setValue ( 0xFF0000FF );
ShapeAppearance.setDiffuseColor(0xFF0000FF);
} else if ( strncmp(axisName, axisRoles[1], strlen(axisRoles[1]) ) == 0 ) {
// Y-axis: green
ShapeColor.setValue ( 0x00FF00FF );
ShapeAppearance.setDiffuseColor(0x00FF00FF);
} else if ( strncmp(axisName, axisRoles[2], strlen(axisRoles[2]) ) == 0 ) {
// Z-axis: blue
ShapeColor.setValue ( 0x0000FFFF );
ShapeAppearance.setDiffuseColor(0x0000FFFF);
}
}
font->size.setValue ( defaultSz / fontRatio );