Materials: ShapeMaterial not properly restored

The ShapeMaterial variable was not being properly restored. It's UUID
was restored but the material was not being loaded and set
This commit is contained in:
David Carter
2024-09-19 09:48:46 -04:00
committed by Chris Hennes
parent 8b9f5bdc4f
commit 669c82fecd

View File

@@ -30,6 +30,7 @@
#include <Base/Writer.h>
#include <Gui/MetaTypes.h>
#include "MaterialManager.h"
#include "MaterialPy.h"
#include "PropertyMaterial.h"
@@ -87,13 +88,14 @@ void PropertyMaterial::Save(Base::Writer& writer) const
void PropertyMaterial::Restore(Base::XMLReader& reader)
{
MaterialManager manager;
// read my Element
reader.readElement("PropertyMaterial");
// get the value of my Attribute
aboutToSetValue();
auto uuid = reader.getAttribute("uuid");
_material.setUUID(QString::fromLatin1(uuid));
hasSetValue();
setValue(*manager.getMaterial(QString::fromLatin1(uuid)));
}
const char* PropertyMaterial::getEditorName() const