Material: Continued Material enahncements
Continues the work of the material subsystem improvements. Several important items are included in this merge. In terms of new capabilities, this merge adds List and MultiLineString as valid property types, complete with editing dialogs. This will help with backwards compatibility for external workbenches, such as Render. Stability has been a big focus. New unit tests help to verify features work as expected. Bugs have been fixed and crashes avoided. Material cards have had a renaming to their tree structure. For example, 'StandardMeterials' is redundant, so this was renamed to 'Standard'. The cards themselves are more compliant fully passing the yamllint tests. More soon.
This commit is contained in:
committed by
Chris Hennes
parent
c81bd982b5
commit
332bf7ed08
@@ -42,9 +42,6 @@ using namespace Materials;
|
||||
|
||||
TYPESYSTEM_SOURCE(Materials::MaterialLibrary, LibraryBase)
|
||||
|
||||
MaterialLibrary::MaterialLibrary()
|
||||
{}
|
||||
|
||||
MaterialLibrary::MaterialLibrary(const QString& libraryName,
|
||||
const QString& dir,
|
||||
const QString& icon,
|
||||
@@ -232,15 +229,16 @@ std::shared_ptr<Material> MaterialLibrary::saveMaterial(std::shared_ptr<Material
|
||||
|
||||
if (file.open(QIODevice::WriteOnly | QIODevice::Text)) {
|
||||
QTextStream stream(&file);
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
stream.setCodec("UTF-8");
|
||||
#endif
|
||||
stream.setGenerateByteOrderMark(true);
|
||||
|
||||
// Write the contents
|
||||
material->setName(info.baseName());
|
||||
material->setLibrary(getptr());
|
||||
material->setDirectory(getRelativePath(path));
|
||||
material->save(stream, saveAsCopy, saveInherited);
|
||||
material->save(stream, overwrite, saveAsCopy, saveInherited);
|
||||
}
|
||||
|
||||
return addMaterial(material, path);
|
||||
@@ -338,7 +336,7 @@ MaterialLibrary::getMaterialTree() const
|
||||
// Empty folders aren't included in _materialPathMap, so we add them by looking at the file
|
||||
// system
|
||||
auto folderList = MaterialLoader::getMaterialFolders(*this);
|
||||
for (auto folder : *folderList) {
|
||||
for (auto& folder : *folderList) {
|
||||
QStringList list = folder.split(QString::fromStdString("/"));
|
||||
|
||||
// Start at the root
|
||||
@@ -364,9 +362,6 @@ MaterialLibrary::getMaterialTree() const
|
||||
|
||||
TYPESYSTEM_SOURCE(Materials::MaterialExternalLibrary, MaterialLibrary::MaterialLibrary)
|
||||
|
||||
MaterialExternalLibrary::MaterialExternalLibrary()
|
||||
{}
|
||||
|
||||
MaterialExternalLibrary::MaterialExternalLibrary(const QString& libraryName,
|
||||
const QString& dir,
|
||||
const QString& icon,
|
||||
|
||||
Reference in New Issue
Block a user