From 669c82fecd81633994dd08f4901dd5ba0da2b0e7 Mon Sep 17 00:00:00 2001 From: David Carter Date: Thu, 19 Sep 2024 09:48:46 -0400 Subject: [PATCH] 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 --- src/Mod/Material/App/PropertyMaterial.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Mod/Material/App/PropertyMaterial.cpp b/src/Mod/Material/App/PropertyMaterial.cpp index 3434b769bb..04d7579235 100644 --- a/src/Mod/Material/App/PropertyMaterial.cpp +++ b/src/Mod/Material/App/PropertyMaterial.cpp @@ -30,6 +30,7 @@ #include #include +#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