From 71a9b8410966c324258bacebce42a3385f2c22b1 Mon Sep 17 00:00:00 2001 From: Jere Tuliniemi Date: Thu, 15 Nov 2018 15:16:27 +0200 Subject: Keep matdef saved path up to date Task-number: QT3DS-2108 Change-Id: Ie3af8dc0ce67f0bdcc50131cc917dbd02f8f08ab Reviewed-by: Miikka Heikkinen --- src/Authoring/Studio/Palettes/Inspector/InspectorControlModel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Authoring/Studio/Palettes/Inspector/InspectorControlModel.cpp b/src/Authoring/Studio/Palettes/Inspector/InspectorControlModel.cpp index ef6eb486..2e670794 100644 --- a/src/Authoring/Studio/Palettes/Inspector/InspectorControlModel.cpp +++ b/src/Authoring/Studio/Palettes/Inspector/InspectorControlModel.cpp @@ -457,6 +457,7 @@ void InspectorControlModel::setMatDatas(const std::vector bool needRewrite = false; if (values.contains(QStringLiteral("path"))) { const QString oldPath = values[QStringLiteral("path")]; + needRewrite = oldPath != absolutePath.toQString(); if (!QFileInfo(oldPath).exists()) { const auto instance = sceneEditor->getMaterial(oldPath); if (instance.Valid()) { @@ -464,7 +465,6 @@ void InspectorControlModel::setMatDatas(const std::vector sceneEditor->GetName(instance).toQString()); if (actualPath == oldPath) { sceneEditor->setMaterialNameByPath(instance, relativePath); - needRewrite = true; QVector refMats; doc->getSceneReferencedMaterials(doc->GetSceneInstance(), refMats); -- cgit v1.2.3