Material: Appearance Updates 2

Improves the use of the ShapeAppearance property for the Part workbench.

    removes DiffuseColor property
        adds Python compatibility using custom attributes
        transitions DiffuseColor to ShapeAppearance on open
    Improved UI elements for setting object appearance, and appearance per face
    Lays the foundation for future texture support
This commit is contained in:
David Carter
2024-06-01 18:26:38 -04:00
committed by Chris Hennes
parent c4d0f3ed97
commit 5feb963f9d
55 changed files with 1540 additions and 714 deletions

View File

@@ -285,9 +285,19 @@ QModelIndex MaterialTreeWidget::findInTree(const QString& uuid)
void MaterialTreeWidget::setMaterial(const QString& uuid)
{
if (uuid.isEmpty() || uuid == m_uuid) {
if (uuid == m_uuid) {
return;
}
if (uuid.isEmpty()) {
// Nothing is selected
QItemSelectionModel* selectionModel = m_materialTree->selectionModel();
selectionModel->clear();
m_material->clear();
return;
}
updateMaterial(uuid);
// Now select the material in the tree
@@ -634,6 +644,11 @@ void MaterialTreeWidget::onSelectMaterial(const QItemSelection& selected,
{
Q_UNUSED(deselected);
if (selected.isEmpty()) {
m_uuid.clear();
return;
}
// Get the UUID before changing the underlying data model
QString uuid;
auto model = dynamic_cast<QStandardItemModel*>(m_materialTree->model());