Material: Appearance and Material inspectors
Dialogs to view the Appearance and Material properties of an object These inspectors are intended to be used when debugging Appearance and Material issues in a model. The Appearance inspector displays the appearance properties of an object. This will be more useful once PR 13792 is merged which migrates parts to use ShapeAppearance instead of DiffuseColor. This shows each of the appearance properties per face for the object. The Material inspector shows the material, models, and properties assigned to a model. It displays useful debugging information such as the UUID and file paths associated with eacch of the items. This is useful when finding and resolving model conflicts. The material inspector now gives the option of copying the information to the clipboard.
This commit is contained in:
committed by
Chris Hennes
parent
bed8b23e7f
commit
a0fdc86948
@@ -50,14 +50,15 @@ MaterialProperty::MaterialProperty()
|
||||
_valuePtr = std::make_shared<MaterialValue>(MaterialValue::None);
|
||||
}
|
||||
|
||||
MaterialProperty::MaterialProperty(const ModelProperty& other)
|
||||
MaterialProperty::MaterialProperty(const ModelProperty& other, QString modelUUID)
|
||||
: ModelProperty(other)
|
||||
, _modelUUID(modelUUID)
|
||||
, _valuePtr(nullptr)
|
||||
{
|
||||
setType(getPropertyType());
|
||||
auto columns = other.getColumns();
|
||||
for (auto& it : columns) {
|
||||
MaterialProperty prop(it);
|
||||
MaterialProperty prop(it, modelUUID);
|
||||
addColumn(prop);
|
||||
}
|
||||
}
|
||||
@@ -657,7 +658,7 @@ void Material::addPhysical(const QString& uuid)
|
||||
ModelProperty property = static_cast<ModelProperty>(it.second);
|
||||
|
||||
try {
|
||||
_physical[propertyName] = std::make_shared<MaterialProperty>(property);
|
||||
_physical[propertyName] = std::make_shared<MaterialProperty>(property, uuid);
|
||||
}
|
||||
catch (const UnknownValueType&) {
|
||||
Base::Console().Error("Property '%s' has unknown type '%s'. Ignoring\n",
|
||||
@@ -733,7 +734,7 @@ void Material::addAppearance(const QString& uuid)
|
||||
if (!hasAppearanceProperty(propertyName)) {
|
||||
ModelProperty property = static_cast<ModelProperty>(it.second);
|
||||
|
||||
_appearance[propertyName] = std::make_shared<MaterialProperty>(property);
|
||||
_appearance[propertyName] = std::make_shared<MaterialProperty>(property, uuid);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ class MaterialsExport MaterialProperty: public ModelProperty
|
||||
public:
|
||||
MaterialProperty();
|
||||
MaterialProperty(const MaterialProperty& other);
|
||||
explicit MaterialProperty(const ModelProperty& other);
|
||||
explicit MaterialProperty(const ModelProperty& other, QString modelUUID);
|
||||
explicit MaterialProperty(const std::shared_ptr<MaterialProperty>& other);
|
||||
~MaterialProperty() override = default;
|
||||
|
||||
@@ -61,7 +61,11 @@ public:
|
||||
return _valuePtr->getType();
|
||||
}
|
||||
|
||||
const QString getModelUUID() const;
|
||||
const QString getModelUUID() const
|
||||
{
|
||||
return _modelUUID;
|
||||
}
|
||||
|
||||
QVariant getValue();
|
||||
QVariant getValue() const;
|
||||
QList<QVariant> getList()
|
||||
@@ -347,10 +351,18 @@ public:
|
||||
{
|
||||
return _physical;
|
||||
}
|
||||
const std::map<QString, std::shared_ptr<MaterialProperty>>& getPhysicalProperties() const
|
||||
{
|
||||
return _physical;
|
||||
}
|
||||
std::map<QString, std::shared_ptr<MaterialProperty>>& getAppearanceProperties()
|
||||
{
|
||||
return _appearance;
|
||||
}
|
||||
const std::map<QString, std::shared_ptr<MaterialProperty>>& getAppearanceProperties() const
|
||||
{
|
||||
return _appearance;
|
||||
}
|
||||
std::map<QString, QString>& getLegacyProperties()
|
||||
{
|
||||
return _legacy;
|
||||
|
||||
@@ -201,10 +201,6 @@ public:
|
||||
{
|
||||
return QDir(_directory).absolutePath();
|
||||
}
|
||||
// const QString getRelativePath() const
|
||||
// {
|
||||
// return QDir(_directory).relativeFilePath(QDir(_directory).absolutePath());
|
||||
// }
|
||||
const QString getUUID() const
|
||||
{
|
||||
return _uuid;
|
||||
|
||||
Reference in New Issue
Block a user