summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJere Tuliniemi <jere.tuliniemi@qt.io>2019-10-01 14:45:42 +0300
committerJere Tuliniemi <jere.tuliniemi@qt.io>2019-10-01 15:17:37 +0300
commit83c7e71670c545fdb766a3d5f887b7f05a802a0a (patch)
tree20be8c41283aa2790d6da2d83e6270514579e73f
parentfdc856278f325a3a41f9db2f706df5332ebd4d5c (diff)
Fix shader file recompilation
Use source path instead of instance name as identifier for custom materials and effects. Task-number: QT3DS-3966 Change-Id: I0de0e38e7a65650c319bcf7c11a7638d175c92fe Reviewed-by: Antti Määttä <antti.maatta@qt.io> Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
-rw-r--r--src/Authoring/Client/Code/Core/Doc/DocumentEditor.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/Authoring/Client/Code/Core/Doc/DocumentEditor.cpp b/src/Authoring/Client/Code/Core/Doc/DocumentEditor.cpp
index 1e60a6be..d97ec491 100644
--- a/src/Authoring/Client/Code/Core/Doc/DocumentEditor.cpp
+++ b/src/Authoring/Client/Code/Core/Doc/DocumentEditor.cpp
@@ -5394,14 +5394,14 @@ public:
} else if (CDialogs::effectExtensions().contains(theExtension)
&& theRecord.m_ModificationType != FileModificationType::Created
&& !theInstances.empty()) {
- CString theNameStr = GetName(theInstances[0].second);
std::vector<SMetaDataLoadWarning> theWarnings;
NVScopedRefCounted<qt3ds::render::IRefCountedInputStream> theStream(
m_InputStreamFactory->GetStreamForFile(theRecord.m_File.toQString()));
if (theStream) {
- m_MetaData.LoadEffectInstance(m_StringTable.GetNarrowStr(theRelativePath.toCString()),
+ m_MetaData.LoadEffectInstance(m_StringTable.GetNarrowStr(
+ theRelativePath.toCString()),
theInstances[0].second,
- TCharStr(theNameStr),
+ theRelativePath.GetFileStem().c_str(),
theWarnings, *theStream);
IDocumentEditor::fixDefaultTexturePaths(theInstances[0].second);
}
@@ -5413,7 +5413,6 @@ public:
} else if (CDialogs::shaderExtensions().contains(theExtension)
&& theRecord.m_ModificationType != FileModificationType::Created
&& !theInstances.empty()) {
- CString theNameStr = GetName(theInstances[0].second);
std::vector<SMetaDataLoadWarning> theWarnings;
NVScopedRefCounted<qt3ds::render::IRefCountedInputStream> theStream(
m_InputStreamFactory->GetStreamForFile(theRecord.m_File.toQString()));
@@ -5421,7 +5420,7 @@ public:
m_MetaData.LoadMaterialInstance(m_StringTable.GetNarrowStr(
theRelativePath.toCString()),
theInstances[0].second,
- TCharStr(theNameStr),
+ theRelativePath.GetFileStem().c_str(),
theWarnings,
*theStream);
IDocumentEditor::fixDefaultTexturePaths(theInstances[0].second);