From 7761f86cec898a0a38ed2e3adddc5ef0fdbdea89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kaj=20Gr=C3=B6nholm?= Date: Wed, 16 Sep 2020 17:30:39 +0300 Subject: Add support for onActivate and onDeactivate Actions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add new Action types onActivate and onDeactivate. When assigned, these will get triggered at object timeline start and end times. Using these it is possible to trigger events at specific times during animation. Example and autotest case included. Task-number: QT3DS-4128 Change-Id: Ib973b479a1de47745089d41c5764c2a1747ec95e Reviewed-by: Antti Määttä Reviewed-by: Tomi Korpipää --- examples/studio3d/simpleqml/main.qml | 8 +-- .../studio3d/simpleqml/presentation/barrel.uip | 67 +++++++++++++--------- res/DataModelMetadata/en-us/MetaData.xml | 2 + src/runtime/Qt3DSActivationManager.cpp | 10 ++++ src/runtime/Qt3DSApplication.cpp | 7 +++ src/runtime/Qt3DSApplication.h | 1 + src/runtime/Qt3DSElementSystem.h | 4 ++ src/runtime/Qt3DSInputEventTypes.h | 3 + src/runtime/Qt3DSKernelTypes.h | 5 +- src/runtime/Qt3DSLogicSystem.cpp | 10 +++- .../q3dssurfaceviewer/tst_q3dssurfaceviewer.cpp | 36 ++++++++++++ .../shared/presentation/activateactions.uip | 55 ++++++++++++++++++ tests/auto/studio3d/shared/shared_presentations.h | 1 + .../auto/studio3d/shared/shared_presentations.qrc | 1 + 14 files changed, 178 insertions(+), 32 deletions(-) create mode 100644 tests/auto/studio3d/shared/presentation/activateactions.uip diff --git a/examples/studio3d/simpleqml/main.qml b/examples/studio3d/simpleqml/main.qml index abdcb79..4cbea83 100644 --- a/examples/studio3d/simpleqml/main.qml +++ b/examples/studio3d/simpleqml/main.qml @@ -77,7 +77,7 @@ Rectangle { Presentation { id: s3dpres source: "qrc:/presentation/barrel.uia" - onCustomSignalEmitted: customSignalName.text = Date.now() + ": " + name + onCustomSignalEmitted: customSignalName.text = Date.now() + ": customSignal:" + name onSlideEntered: slideEnter.text = "Entered slide " + name + "(index " + index + ") on " + elementPath onSlideExited: slideExit.text = "Exited slide " + name + "(index " + index + ") on " + elementPath @@ -218,19 +218,19 @@ Rectangle { id: customSignalName anchors.bottom: parent.bottom anchors.left: fpsCount.right - anchors.leftMargin: 8 + anchors.leftMargin: 30 } Text { id: slideEnter anchors.bottom: parent.bottom anchors.left: customSignalName.right - anchors.leftMargin: 8 + anchors.leftMargin: 30 } Text { id: slideExit anchors.bottom: parent.bottom anchors.left: slideEnter.right - anchors.leftMargin: 8 + anchors.leftMargin: 30 } Button { id: nextSlideByIndex diff --git a/examples/studio3d/simpleqml/presentation/barrel.uip b/examples/studio3d/simpleqml/presentation/barrel.uip index 7b9b2fb..c36f0e5 100644 --- a/examples/studio3d/simpleqml/presentation/barrel.uip +++ b/examples/studio3d/simpleqml/presentation/barrel.uip @@ -1,47 +1,54 @@ - + #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff + + + + + + - - - - - - - - - - + + + + + + + + + + - - + + + - - - - - - + + + + + + 0 90 100 100 5 64 100 100 10 90 100 100 0 0 100 100 5 -302 100 100 10 0 100 100 0 0 100 100 5 0 100 100 10 0 100 100 - + 0 0 100 100 5 1 100 100 - - - - - + + + + + 0 100 100 100 5.009 43.75 100 100 10 100 100 100 0 0 100 100 4.997 0 100 100 5.009 0 100 100 10 0 100 100 0 0 100 100 4.997 0 100 100 5.009 0 100 100 10 360 100 100 @@ -50,7 +57,15 @@ 0 1 100 100 5.009 0.235294 100 100 10 1 100 100 0 0 100 100 5.009 0.333333 100 100 10 0 100 100 - + + + + + + + + + diff --git a/res/DataModelMetadata/en-us/MetaData.xml b/res/DataModelMetadata/en-us/MetaData.xml index c5d2458..b793df7 100644 --- a/res/DataModelMetadata/en-us/MetaData.xml +++ b/res/DataModelMetadata/en-us/MetaData.xml @@ -49,6 +49,8 @@ + +