From 7938d4234b928f96bfefcfb03acdec92adfdb469 Mon Sep 17 00:00:00 2001 From: Jere Tuliniemi Date: Fri, 23 Nov 2018 15:40:02 +0200 Subject: Fix refresh import moving materials Also, use source path as an identifier instead of the material name. Task-number: QT3DS-2108 Change-Id: I72f7a0e15cc84034b20baea98208c2b939550010 Reviewed-by: Miikka Heikkinen --- src/Authoring/Client/Code/Core/Doc/ComposerEditorInterface.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Authoring/Client/Code/Core/Doc/ComposerEditorInterface.cpp b/src/Authoring/Client/Code/Core/Doc/ComposerEditorInterface.cpp index 6e1aa2fa..a6ac8e29 100644 --- a/src/Authoring/Client/Code/Core/Doc/ComposerEditorInterface.cpp +++ b/src/Authoring/Client/Code/Core/Doc/ComposerEditorInterface.cpp @@ -614,7 +614,7 @@ struct SComposerRefreshInterface : public SComposerImportBase, public IComposerE m_Editor.GetChildren(0, parent, children); Qt3DSDMInstanceHandle oldVersion; for (auto &child : children) { - if (m_Editor.GetName(child) == materialName + if (m_Editor.GetSourcePath(child) == sourcePath && m_Editor.GetObjectTypeName(child) == "ReferencedMaterial") { oldVersion = child; break; @@ -716,6 +716,8 @@ struct SComposerRefreshInterface : public SComposerImportBase, public IComposerE Qt3DSDMSlideHandle theParentSlide = theParentList->second[idx].first; Qt3DSDMInstanceHandle theParent(theParentList->second[idx].second); Qt3DSDMInstanceHandle theChild(theChildList->second[idx].second); + if (m_createdMaterials.contains(theChild)) + continue; Qt3DSDMInstanceHandle nextSibling; if (!IsTrivial(nextSiblingId)) { for (long childIdx = 0, childCount = m_AssetGraph.GetChildCount(theParent); -- cgit v1.2.3