Materials: Physical property attributes

Add dynamic attributes to report the physical attributes of a part that
are automatically recalculaated when the shape or material changes.
These values are accessible from the part data display and as attributes
within Python
This commit is contained in:
David Carter
2024-10-24 00:10:46 -04:00
committed by Yorik van Havre
parent 223877873b
commit 6af113bc4f
7 changed files with 105 additions and 8 deletions

View File

@@ -83,13 +83,11 @@ DlgMaterialImp::DlgMaterialImp(bool floating, QWidget* parent, Qt::WindowFlags f
d->floating = floating;
// // Create a filter to only include current format materials
// // that contain the basic render model.
// auto filter = std::make_shared<Materials::MaterialFilter>();
// filter->setIncludeEmptyFolders(false);
// filter->setIncludeLegacy(false);
// filter->addRequiredComplete(Materials::ModelUUIDs::ModelUUID_Rendering_Basic);
// d->ui.widgetMaterial->setFilter(filter);
// Create a filter to only include current format materials
// that contain physical properties.
auto filter = std::make_shared<Materials::MaterialFilter>();
filter->requirePhysical(true);
d->ui.widgetMaterial->setFilter(filter);
std::vector<App::DocumentObject*> objects = getSelectionObjects();
setMaterial(objects);