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

@@ -227,7 +227,7 @@ def upgrade(objects, delete=False, force=None):
# of downgrade, nor do they have the same hashCode().
# Nevertheless, they still keep reference to their original
# colors, capture that in facecolors.
# Also, cannot use ShapeColor here, we need a whole array
# Also, cannot use ShapeAppearance here, we need a whole array
# matching the colors of the array of faces per object,
# only DiffuseColor has that
facecolors[0].extend(obj.ViewObject.DiffuseColor)

View File

@@ -474,7 +474,7 @@ def format_object(target, origin=None):
If construction mode is active target is then placed in the construction
group and the `constr` color is applied to its applicable color properties:
TextColor, PointColor, LineColor, and ShapeColor.
TextColor, PointColor, LineColor, and ShapeAppearance.
Parameters
----------

View File

@@ -88,14 +88,14 @@ def get_default_shape_style():
display_mode_index = params.get_param("DefaultDisplayMode")
draw_style_index = params.get_param("DefaultDrawStyle")
return {
"DisplayMode": ("index", display_mode_index, DISPLAY_MODES[display_mode_index]),
"DrawStyle": ("index", draw_style_index, DRAW_STYLES[draw_style_index]),
"LineColor": ("color", params.get_param_view("DefaultShapeLineColor")),
"LineWidth": ("int", params.get_param_view("DefaultShapeLineWidth")),
"PointColor": ("color", params.get_param_view("DefaultShapeVertexColor")),
"PointSize": ("int", params.get_param_view("DefaultShapePointSize")),
"ShapeColor": ("color", params.get_param_view("DefaultShapeColor")),
"Transparency": ("int", params.get_param_view("DefaultShapeTransparency"))
"DisplayMode": ("index", display_mode_index, DISPLAY_MODES[display_mode_index]),
"DrawStyle": ("index", draw_style_index, DRAW_STYLES[draw_style_index]),
"LineColor": ("color", params.get_param_view("DefaultShapeLineColor")),
"LineWidth": ("int", params.get_param_view("DefaultShapeLineWidth")),
"PointColor": ("color", params.get_param_view("DefaultShapeVertexColor")),
"PointSize": ("int", params.get_param_view("DefaultShapePointSize")),
"ShapeColor": ("color", params.get_param_view("DefaultShapeColor")),
"Transparency": ("int", params.get_param_view("DefaultShapeTransparency"))
}

View File

@@ -70,16 +70,16 @@ class ViewProviderLayer:
_tip)
vobj.OverrideLineColorChildren = True
if "OverrideShapeColorChildren" not in properties:
if "OverrideShapeAppearanceChildren" not in properties:
_tip = QT_TRANSLATE_NOOP("App::Property",
"If it is true, the objects contained "
"within this layer will adopt "
"the shape color of the layer")
vobj.addProperty("App::PropertyBool",
"OverrideShapeColorChildren",
"OverrideShapeAppearanceChildren",
"Layer",
_tip)
vobj.OverrideShapeColorChildren = True
vobj.OverrideShapeAppearanceChildren = True
if "UsePrintColor" not in properties:
_tip = QT_TRANSLATE_NOOP("App::Property",