diff options
author | Antti Määttä <antti.maatta@qt.io> | 2019-05-06 15:47:23 +0300 |
---|---|---|
committer | Antti Määttä <antti.maatta@qt.io> | 2019-05-07 08:00:10 +0000 |
commit | 0c4ffac9163ffdcf04d9307eb391f0534af9badd (patch) | |
tree | 6feabe7185adaf0e92a4526e231707b7ee7e883e | |
parent | 48362d4a2496b611407077bf36151fa31ef55fc4 (diff) |
Fix transparency check in editor
The transparency check is not enabled for images used in
material container due to previous change. Re-enable the check when
presentation is saved.
Task-number: QT3DS-3357
Change-Id: I55888df7b38d3f3b14dfb578b8ae14cafdf1c8e4
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
Reviewed-by: Jari Karppinen <jari.karppinen@qt.io>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
-rw-r--r-- | src/Authoring/Client/Code/Core/Doc/Doc.cpp | 2 | ||||
-rw-r--r-- | src/Authoring/Client/Code/Core/Doc/DocumentEditor.cpp | 22 | ||||
-rw-r--r-- | src/Authoring/Client/Code/Core/Doc/IDocumentReader.h | 3 |
3 files changed, 15 insertions, 12 deletions
diff --git a/src/Authoring/Client/Code/Core/Doc/Doc.cpp b/src/Authoring/Client/Code/Core/Doc/Doc.cpp index 5d8bc44e..0a32a3c2 100644 --- a/src/Authoring/Client/Code/Core/Doc/Doc.cpp +++ b/src/Authoring/Client/Code/Core/Doc/Doc.cpp @@ -2560,7 +2560,7 @@ void CDoc::SavePresentationFile(CBufferedOutputStream *inOutputStream) CClientDataModelBridge &theBridge = *(m_StudioSystem->GetClientDataModelBridge()); IPropertySystem &thePropertySystem = *(m_StudioSystem->GetPropertySystem()); TCharPtrToSlideInstanceMap sourcePathToInstanceMap; - m_SceneEditor->GetSourcePathToInstanceMap(sourcePathToInstanceMap); + m_SceneEditor->GetSourcePathToInstanceMap(sourcePathToInstanceMap, false, false); // Ensure the image is loaded in the image buffer system // because this scans the image for alpha bits. for (TCharPtrToSlideInstanceMap::iterator theIter = sourcePathToInstanceMap.begin(), diff --git a/src/Authoring/Client/Code/Core/Doc/DocumentEditor.cpp b/src/Authoring/Client/Code/Core/Doc/DocumentEditor.cpp index 1b5e09f3..65381efb 100644 --- a/src/Authoring/Client/Code/Core/Doc/DocumentEditor.cpp +++ b/src/Authoring/Client/Code/Core/Doc/DocumentEditor.cpp @@ -421,8 +421,9 @@ public: } void GetPathToInstanceMap(TCharPtrToSlideInstanceMap &outInstanceMap, - qt3dsdm::Qt3DSDMPropertyHandle inProperty, - bool inIncludeIdentifiers = true) const + qt3dsdm::Qt3DSDMPropertyHandle property, + bool checkMaterialContainers = true, + bool includeIdentifiers = true) const { SComposerObjectDefinitions &theDefinitions(m_Bridge.GetObjectDefinitions()); TInstanceHandleList existing; @@ -432,17 +433,17 @@ public: for (size_t idx = 0, end = existing.size(); idx < end; ++idx) { Qt3DSDMInstanceHandle theAsset(existing[idx]); - if (m_Bridge.isInsideMaterialContainer(theAsset)) + if (checkMaterialContainers && m_Bridge.isInsideMaterialContainer(theAsset)) continue; thePaths.clear(); - GetAllPaths(theAsset, inProperty, thePaths); + GetAllPaths(theAsset, property, thePaths); for (size_t pathIdx = 0, pathEnd = thePaths.size(); pathIdx < pathEnd; ++pathIdx) { const pair<qt3dsdm::Qt3DSDMSlideHandle, Q3DStudio::CString> &theSlideStr( thePaths[pathIdx]); CFilePath thePath(theSlideStr.second); - if (inIncludeIdentifiers == false) + if (!includeIdentifiers) thePath = thePath.filePath(); const wchar_t *theString = m_DataCore.GetStringTable().RegisterStr( thePath.toCString()); @@ -455,17 +456,18 @@ public: } void GetSourcePathToInstanceMap(TCharPtrToSlideInstanceMap &outInstanceMap, - bool inIncludeIdentifiers = true) const override + bool checkMaterialContainers = true, + bool includeIdentifiers = true) const override { SComposerObjectDefinitions &theDefinitions(m_Bridge.GetObjectDefinitions()); GetPathToInstanceMap(outInstanceMap, theDefinitions.m_Asset.m_SourcePath, - inIncludeIdentifiers); + checkMaterialContainers, includeIdentifiers); } void GetImportPathToInstanceMap(TCharPtrToSlideInstanceMap &outInstanceMap) const override { SComposerObjectDefinitions &theDefinitions(m_Bridge.GetObjectDefinitions()); - GetPathToInstanceMap(outInstanceMap, theDefinitions.m_Asset.m_ImportFile, false); + GetPathToInstanceMap(outInstanceMap, theDefinitions.m_Asset.m_ImportFile, true, false); } bool CanPropertyBeLinked(TInstanceHandle inInstance, TPropertyHandle inProperty) const override @@ -4839,7 +4841,7 @@ public: ScopedBoolean __ignoredDirs(m_IgnoreDirChange); try { m_SourcePathInstanceMap.clear(); - GetSourcePathToInstanceMap(m_SourcePathInstanceMap, false); + GetSourcePathToInstanceMap(m_SourcePathInstanceMap, true, false); DoRefreshImport(inOldFile, inNewFile); } catch (...) { } @@ -4856,7 +4858,7 @@ public: try { vector<CFilePath> importFileList; m_SourcePathInstanceMap.clear(); - GetSourcePathToInstanceMap(m_SourcePathInstanceMap, false); + GetSourcePathToInstanceMap(m_SourcePathInstanceMap, true, false); for (TCharPtrToSlideInstanceMap::iterator theIter = m_SourcePathInstanceMap.begin(), end = m_SourcePathInstanceMap.end(); theIter != end; ++theIter) { diff --git a/src/Authoring/Client/Code/Core/Doc/IDocumentReader.h b/src/Authoring/Client/Code/Core/Doc/IDocumentReader.h index d0f563aa..514d1f98 100644 --- a/src/Authoring/Client/Code/Core/Doc/IDocumentReader.h +++ b/src/Authoring/Client/Code/Core/Doc/IDocumentReader.h @@ -154,7 +154,8 @@ public: // link to that source path and under which slide. // Pass in true if you want the map keys to include the identifiers (#1, #2). virtual void GetSourcePathToInstanceMap(TCharPtrToSlideInstanceMap &outInstanceMap, - bool inIncludeIdentifiers = true) const = 0; + bool checkMaterialContainers = true, + bool includeIdentifiers = true) const = 0; // Get a map from string table string to list of slide/instance pairs that indicates, for a // given source path, // which instances link to that source path under which slide. |