diff options
author | Miikka Heikkinen <miikka.heikkinen@qt.io> | 2018-11-26 13:47:41 +0200 |
---|---|---|
committer | Miikka Heikkinen <miikka.heikkinen@qt.io> | 2018-11-27 09:06:15 +0000 |
commit | ff38229c8694f1be39757c4ab904395f834af0d6 (patch) | |
tree | 4e1a39c113e73d32a062e674ab72117509433268 | |
parent | 7938d4234b928f96bfefcfb03acdec92adfdb469 (diff) |
Fix subpresentation disappearing when it's animation is less than 10s
Runtime 1 was checking material container duration to determine
subpresentation animation run time.
Task-number: QT3DS-2606
Change-Id: I395691aa3c6c383254ba92b7c0ff95a0857f56c8
Reviewed-by: Jere Tuliniemi <jere.tuliniemi@qt.io>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
-rw-r--r-- | src/Runtime/Source/UIPParser/Source/Qt3DSUIPParserImpl.cpp | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/src/Runtime/Source/UIPParser/Source/Qt3DSUIPParserImpl.cpp b/src/Runtime/Source/UIPParser/Source/Qt3DSUIPParserImpl.cpp index 35ffa3b0..52aaa180 100644 --- a/src/Runtime/Source/UIPParser/Source/Qt3DSUIPParserImpl.cpp +++ b/src/Runtime/Source/UIPParser/Source/Qt3DSUIPParserImpl.cpp @@ -1928,13 +1928,17 @@ SElementData *CUIPParserImpl::AddSlideElement(IPresentation &inPresentation, boo theBuilder.AddSlideElement(*theElement, theActiveFlag); m_NumSlideElements++; if (outMaxTime) { - INT32 theElementMaxTime; + INT32 theElementMaxTime = 0; SElement *theParent = theElement->GetParent(); - if (theParent && theParent->IsComponent()) { - if (inReader.Att("endtime", theElementMaxTime) == false) { + if (theParent && theParent->IsComponent() && theElement) { + // Ignore material durations (in practice this is always a material container) + qt3dsdm::ComposerObjectTypes::Enum composerType( + qt3dsdm::ComposerObjectTypes::Convert(theElementData->m_Type.c_str())); + if (composerType != qt3dsdm::ComposerObjectTypes::Material + && inReader.Att("endtime", theElementMaxTime) == false) { theElementMaxTime = m_MetaData.GetPropertyValueLong( - theElementData->m_Type, m_MetaData.Register("endtime"), - theElementData->m_Class); + theElementData->m_Type, m_MetaData.Register("endtime"), + theElementData->m_Class); } *outMaxTime = NVMax(*outMaxTime, theElementMaxTime); } @@ -2070,11 +2074,17 @@ BOOL CUIPParserImpl::LoadSlideElements(IPresentation &inPresentation, qt3dsdm::I if (outMaxTime && theData->m_Element) { SElement *theParent = theData->m_Element->GetParent(); if (theParent && theParent->IsComponent()) { - long theoutMaxTime = (long)*outMaxTime; - long theMaxTime = m_MetaData.GetPropertyValueLong( - theData->m_Type, m_MetaData.Register("endtime"), - theData->m_Class); - *outMaxTime = NVMax(theoutMaxTime, theMaxTime); + // Ignore material durations + // (in practice this is always a material container) + qt3dsdm::ComposerObjectTypes::Enum composerType( + qt3dsdm::ComposerObjectTypes::Convert(theData->m_Type.c_str())); + if (composerType != qt3dsdm::ComposerObjectTypes::Material) { + long theoutMaxTime = (long)*outMaxTime; + long theMaxTime = m_MetaData.GetPropertyValueLong( + theData->m_Type, m_MetaData.Register("endtime"), + theData->m_Class); + *outMaxTime = NVMax(theoutMaxTime, theMaxTime); + } } } } |