From b04e20c05278267a168b07cabfd74a67e33539de Mon Sep 17 00:00:00 2001 From: Jari Karppinen Date: Wed, 19 Jun 2019 13:48:29 +0300 Subject: Ignore start time in time graph node if it hasn't been set MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Animated custom materials only have the endtime attribute in .uip files. This causes the start time in time graph nodes not to be updated. The value is left as the default QT3DS_MAX_U32 which causes the element to be excluded from animation. Task-number: QT3DS-3682 Change-Id: I6eec94ea222d4d830d4e793429c37888e9f097e5 Reviewed-by: Antti Määttä Reviewed-by: Miikka Heikkinen --- src/runtime/Qt3DSActivationManager.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/runtime/Qt3DSActivationManager.cpp b/src/runtime/Qt3DSActivationManager.cpp index 3d05274..1449f6e 100644 --- a/src/runtime/Qt3DSActivationManager.cpp +++ b/src/runtime/Qt3DSActivationManager.cpp @@ -45,6 +45,7 @@ #include "foundation/Qt3DSMutex.h" #include "foundation/Qt3DSSync.h" #include "Qt3DSRenderThreadPool.h" +#include "foundation/Qt3DSSimpleTypes.h" using namespace qt3ds::runtime; using namespace qt3ds::runtime::element; @@ -405,7 +406,9 @@ struct STimeContext if (inNode.DoesParticipateInTimeGraph()) { UpdateNodeElementInformation(inNode); if (inNode.IsUserActive()) { - inGlobalMin = NVMax(inNode.m_ActivationManagerNode.m_StartTime, inGlobalMin); + // Start time does not get updated if the element doesn't have ATTRIBUTE_STARTTIME. + if (inNode.m_ActivationManagerNode.m_StartTime != QT3DS_MAX_U32) + inGlobalMin = NVMax(inNode.m_ActivationManagerNode.m_StartTime, inGlobalMin); inGlobalMax = NVMin(inNode.m_ActivationManagerNode.m_StopTime, inGlobalMax); if (inGlobalMin < inGlobalMax) { GetTimeEventForTime(inGlobalMin, STimeEvent::Start) -- cgit v1.2.3