Material: Material API fixes

Corrects an issue in the API where a new material may not have a UUID.
Corrected the test case to reflect the changes and better document the
process.

Added a test case for material filters.
This commit is contained in:
David Carter
2024-05-13 22:41:54 -04:00
committed by Chris Hennes
parent b231bbb0ca
commit ed01d5cffa
13 changed files with 404 additions and 25 deletions

View File

@@ -448,7 +448,10 @@ Material::Material()
: _dereferenced(false)
, _oldFormat(false)
, _editState(ModelEdit_None)
{}
{
// Create an initial UUID
newUuid();
}
Material::Material(const std::shared_ptr<MaterialLibrary>& library,
const QString& directory,
@@ -1439,7 +1442,6 @@ void Material::save(QTextStream& stream, bool overwrite, bool saveAsCopy, bool s
if (materialManager.exists(_uuid) && !overwrite) {
// Make a new version based on the current
setParentUUID(_uuid);
// newUuid();
}
}