Add proper tooltips for Material properties #24434 (#25509)

This commit is contained in:
timpieces
2025-12-11 22:56:26 +08:00
committed by GitHub
parent 7a8135d863
commit de2f8a58a3
5 changed files with 139 additions and 6 deletions

View File

@@ -200,6 +200,10 @@ QWidget* DlgInspectAppearance::makeAppearanceTab(const App::Material& material)
int row = 0;
auto* labelDiffuse = new QLabel();
labelDiffuse->setText(tr("Diffuse color"));
labelDiffuse->setToolTip(
tr("Defines the base color of a surface when illuminated by light. It represents how the "
"object scatters light evenly in all directions, independent of the viewers angle. "
"This property will influence the material color the most."));
auto* colorDiffuse = new ColorWidget(material.diffuseColor);
colorDiffuse->setMaximumHeight(23);
@@ -209,6 +213,10 @@ QWidget* DlgInspectAppearance::makeAppearanceTab(const App::Material& material)
auto* labelAmbient = new QLabel();
labelAmbient->setText(tr("Ambient color"));
labelAmbient->setToolTip(
tr("Defines the color of a surface under indirect, uniform lighting, representing how it "
"appears when illuminated only by ambient light in a scene, without directional light, "
"shading, or highlights"));
auto* colorAmbient = new ColorWidget(material.ambientColor);
colorAmbient->setMaximumHeight(23);
@@ -218,6 +226,10 @@ QWidget* DlgInspectAppearance::makeAppearanceTab(const App::Material& material)
auto* labelEmissive = new QLabel();
labelEmissive->setText(tr("Emissive color"));
labelEmissive->setToolTip(
tr("Defines the color of a surface that appears to emit as if it were a light source, "
"independent of external lighting, making the object look self-illuminated. Set to "
"black to have no emissive color."));
auto* colorEmissive = new ColorWidget(material.emissiveColor);
colorEmissive->setMaximumHeight(23);
@@ -227,6 +239,10 @@ QWidget* DlgInspectAppearance::makeAppearanceTab(const App::Material& material)
auto* labelSpecular = new QLabel();
labelSpecular->setText(tr("Specular color"));
labelSpecular->setToolTip(
tr("Defines the color and intensity of the bright, mirror-like highlights that appear on "
"shiny or reflective surfaces when light hits them directly. Set to bright colors for "
"shiny objects."));
auto* colorSpecular = new ColorWidget(material.specularColor);
colorSpecular->setMaximumHeight(23);
@@ -236,6 +252,10 @@ QWidget* DlgInspectAppearance::makeAppearanceTab(const App::Material& material)
auto* labelShininess = new QLabel();
labelShininess->setText(tr("Shininess"));
labelShininess->setToolTip(
tr("Defines the size and sharpness of specular highlights on a surface. Higher values "
"produce small, sharp highlights, while lower values create broad, soft highlights. "
"Note that the highlight intensity is defined by specular color."));
auto* editShininess = new QLineEdit();
editShininess->setText(QString::number(material.shininess));
editShininess->setEnabled(false);
@@ -246,6 +266,8 @@ QWidget* DlgInspectAppearance::makeAppearanceTab(const App::Material& material)
auto* labelTransparency = new QLabel();
labelTransparency->setText(tr("Transparency"));
labelTransparency->setToolTip(tr("Defines how much light passes through an object, making it "
"partially or fully see-through"));
auto* editTransparency = new QLineEdit();
editTransparency->setText(QString::number(material.transparency));
editTransparency->setEnabled(false);

View File

@@ -34,32 +34,51 @@ AppearanceModel:
Type: 'Color'
Units: ''
URL: ''
Description: " "
Description: >
Defines the color of a surface under indirect, uniform lighting,
representing how it appears when illuminated only by ambient light in a
scene, without directional light, shading, or highlights
DiffuseColor:
DisplayName: "Diffuse Color"
Type: 'Color'
Units: ''
URL: ''
Description: " "
Description: >
Defines the base color of a surface when illuminated by light. It
represents how the object scatters light evenly in all directions,
independent of the viewers angle. This property will influence the
material color the most.
EmissiveColor:
DisplayName: "Emissive Color"
Type: 'Color'
Units: ''
URL: ''
Description: " "
Description: >
Defines the color of a surface that appears to emit as if it were a light
source, independent of external lighting, making the object look
self-illuminated. Set to black to have no emissive color.
Shininess:
Type: 'Float'
Units: ''
URL: ''
Description: " "
Description: >
Defines the size and sharpness of specular highlights on a surface.
Higher values produce small, sharp highlights, while lower values create
broad, soft highlights. Note that the highlight intensity is defined by
specular color."
SpecularColor:
DisplayName: "Specular Color"
Type: 'Color'
Units: ''
URL: ''
Description: " "
Description: >
Defines the color and intensity of the bright, mirror-like highlights
that appear on shiny or reflective surfaces when light hits them
directly. Set to bright colors for shiny objects.
Transparency:
Type: 'Float'
Units: ''
URL: ''
Description: " "
Description: >
Defines how much light passes through an object, making it partially or
fully see-through