diff options
author | Tomi Korpipaa <tomi.korpipaa@qt.io> | 2018-05-29 09:39:31 +0300 |
---|---|---|
committer | Andy Nichols <andy.nichols@qt.io> | 2018-05-29 08:24:43 +0000 |
commit | 5f625401ebe432648208edc58fc8f862659284c4 (patch) | |
tree | e93d924c19c2dd76dcb601e2471a69d9abd9558f /src/Authoring/Client/Code/Core/Doc/IComposerSerializer.cpp | |
parent | 1ffc64911a8add299a49426be5711f43959602b0 (diff) |
Clean up old mesh revisions from old presentations
Task-number: QT3DS-1790
Change-Id: I988a3f09ee4a9daaa4ce3dd08e2ae56850964cb0
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'src/Authoring/Client/Code/Core/Doc/IComposerSerializer.cpp')
-rw-r--r-- | src/Authoring/Client/Code/Core/Doc/IComposerSerializer.cpp | 46 |
1 files changed, 7 insertions, 39 deletions
diff --git a/src/Authoring/Client/Code/Core/Doc/IComposerSerializer.cpp b/src/Authoring/Client/Code/Core/Doc/IComposerSerializer.cpp index c78fe7ea..257f88e1 100644 --- a/src/Authoring/Client/Code/Core/Doc/IComposerSerializer.cpp +++ b/src/Authoring/Client/Code/Core/Doc/IComposerSerializer.cpp @@ -1480,16 +1480,11 @@ struct SComposerSerializerImpl : public IComposerSerializer TPropertyHandleValuePairList &outProperties) { bool hasNoLifetime = - m_DataCore.IsInstanceOrDerivedFrom(inInstance, m_ObjectDefinitions.m_Image.m_Instance) + m_DataCore.IsInstanceOrDerivedFrom(inInstance, + m_ObjectDefinitions.m_Image.m_Instance) || m_DataCore.IsInstanceOrDerivedFrom(inInstance, m_ObjectDefinitions.m_Material.m_Instance); - bool checkConversionToV3LayerFormat = false; - if (m_UIPVersion.hasValue() && *m_UIPVersion < 3 - && m_DataCore.IsInstanceOrDerivedFrom(inInstance, - m_ObjectDefinitions.m_Layer.m_Instance)) - checkConversionToV3LayerFormat = true; - for (eastl::pair<TCharPtr, TCharPtr> theAtt = inReader.GetFirstAttribute(); !IsTrivial(theAtt.first); theAtt = inReader.GetNextAttribute()) { Option<pair<Qt3DSDMPropertyHandle, SValue>> theValue = @@ -1497,38 +1492,11 @@ struct SComposerSerializerImpl : public IComposerSerializer bool ignoreProperty = theValue.hasValue() == false || (hasNoLifetime && (theValue->first == m_ObjectDefinitions.m_Asset.m_StartTime.m_Property - || theValue->first == m_ObjectDefinitions.m_Asset.m_EndTime.m_Property)); - if (ignoreProperty) { - bool keepProperty = true; - if (checkConversionToV3LayerFormat) { - if (AreEqual(theAtt.first, L"location") || AreEqual(theAtt.first, L"size")) { - keepProperty = false; - SValue theValueUnion = ParseValue(DataModelDataType::Float2, theAtt.second); - SFloat2 theValue(theValueUnion.getData<SFloat2>()); - SValue theFirstValue(theValue.m_Floats[0]); - SValue theSecondValue(theValue.m_Floats[1]); - if (AreEqual(theAtt.first, L"location")) { - Qt3DSDMPropertyHandle theLeft, theTop; - theLeft = - m_DataCore.GetAggregateInstancePropertyByName(inInstance, L"left"); - theTop = - m_DataCore.GetAggregateInstancePropertyByName(inInstance, L"top"); - outProperties.push_back(std::make_pair(theLeft, theFirstValue)); - outProperties.push_back(std::make_pair(theTop, theSecondValue)); - } else { - Qt3DSDMPropertyHandle theWidth, theHeight; - theWidth = - m_DataCore.GetAggregateInstancePropertyByName(inInstance, L"width"); - theHeight = m_DataCore.GetAggregateInstancePropertyByName(inInstance, - L"height"); - outProperties.push_back(std::make_pair(theWidth, theFirstValue)); - outProperties.push_back(std::make_pair(theHeight, theSecondValue)); - } - } - } - if (keepProperty) - outExtraAttributes.push_back(std::make_pair(theAtt.first, theAtt.second)); - } else + || theValue->first + == m_ObjectDefinitions.m_Asset.m_EndTime.m_Property)); + if (ignoreProperty) + outExtraAttributes.push_back(std::make_pair(theAtt.first, theAtt.second)); + else outProperties.push_back(std::make_pair(theValue->first, theValue->second)); } } |