summaryrefslogtreecommitdiffstats
path: root/src/runtime/q3dsslideplayer_p.h
Commit message (Collapse)AuthorAgeFilesLines
* Fix EOS logic in the animatorChristian Strømme2019-03-201-0/+2
| | | | | | | | | | | | | The logic was broken and in some cases we would not detect that we reached the end e.g, when the local time was equal to the duration, in this case we ended up in a no-op situation and the slide state would not change and the timeChangeCallback would never be called, which meant that visibility wasn't updated as expected. Fixes: QT3DS-3080 Change-Id: Ic6dcfd08ef13a18b769cf5eea3113ec31b776d95 Reviewed-by: Janne Kangas <janne.kangas@qt.io> Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
* Add missing override specifiersChristian Strømme2019-03-201-23/+23
| | | | | | | [-Werror,-Winconsistent-missing-override] Change-Id: Ibf3ad506649642830cc159a6b2fa06b73f40bafc Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
* DragonsWingsChristian Strømme2018-12-101-238/+9
| | | | | | | | | | This adds the basis for the dragon wings animation system, which is a light weight animator that works directly with the qt3ds' graph objects. To enable it pass --dragon-wings to the viewer or set the env variable DRAGONWINGS. Change-Id: I4403b1ac5f8c96a62993fa2043af9c611be64abb Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Fix unlinked properties not being applied when there are no tracksChristian Strømme2018-11-071-0/+2
| | | | | | | | | | | Notifying property changes was delayed until the track starts, but if there's no tracks this will never happen, so instead we now delay the calls until the slide animator (always present) is first called, which happens even if the slide is initially paused. Task-number: QT3DS-2596 Change-Id: I3fd49977b90ac370680446ecbfc7b3301130de34 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Revert "Improve state handling"Christian Strømme2018-11-061-6/+4
| | | | | | | | | | | This commit is introducing to many regressions at this point, so the best option is to revert it now and re-apply once the remaining issue are resolved. This reverts commit 55b43d3e1c3a100f4ad41d94c132afd2a0d029b3. Change-Id: If2733c506aa64a242a4605d81d69f66e2f7aae41 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Change PlayerType names to Scene and ComponentChristian Strømme2018-10-291-3/+3
| | | | | | | ... the names Slide and ComponentSlide doesn't make much sense. Change-Id: I19d76012625d4d5c2eb4ed379305c21586678455 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Improve state handlingChristian Strømme2018-10-291-4/+6
| | | | | | | | | | | | | | | | | | | | This is an attempt to clean up and make the state changes more sane, i.e., by trying do everything once and in the right order. There are still ugliness in this code, but it should be more easily to follow now, aided by extra inline commentary. This change should also improve some of the flickering seen in some examples when changing slides, as we try avoid re-setting stuff when we don't need to. Since time updates for the new slide is deferred until the first time callback, some of the test needed to be changed to their QTRY_* version. Also, there's now a clear distinction between stopped and paused, where paused means the slides progress is stopped at time t, as expected and stopped means the slides values and state is reset to it's initial state. Task-number: QT3DS-1866 Change-Id: I7a9b61ee3ad4a976e0e8d4de386704dcf0d526bf Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Add some more time-stamps to the slide playerChristian Strømme2018-09-141-1/+1
| | | | | | | | This is helpful when debugging visibility updates and also to see when we reach EOS. Change-Id: I926954a6ece3b0ba0b201a8c258bd664af60a53e Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Fix frequent visibility updates at start/end for slidesChristian Strømme2018-09-121-1/+1
| | | | | | | | | | The start and end time was used to decide if we should force a re-evaluation of the objects visibility, which in some cases caused a lot of traffic. This change makes the forced update explicit, so we don't trigger unnecessarily updates. Change-Id: I3005a968aacead42baa4907d0d25d91704151ac0 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Don't use dynamic values when entering the first slideChristian Strømme2018-09-071-1/+1
| | | | | | | | | | | When entering the first slide there's no previous values available, so the initial default value was used. Instead of applying these values we should just skip updating the dynamic values when there's no previous slide. Task-number: QT3DS-2209 Change-Id: I5b8d184c3c27d37758259a0585948a7be9580aff Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Make object visibility behave correctly when associating with slidesLaszlo Agocs2018-07-111-0/+4
| | | | | | | | | | | | | | | | | | Add stubs for handling other Q3DSSlide changes as well. The focus for now is however on cases like this: primitive(kocka,kocka,#Cube,Layer,null) // now the cube and material are in the scenegraph but not in any slide's objects() list so the cube does not show up objslideadd(kocka,Slide1) // now the cube should show up (assuming Slide1 is the current slide) objslideremove(kocka,Slide1) // the cube should disappear Change-Id: I02cc2dd6d7d044ca9a9bdd462928d7f571d185e4 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Get visibilities updated when adding new objectsLaszlo Agocs2018-06-201-0/+2
| | | | | | | | This is done by performing the same steps as in setSlideTime, but only for the objects that has been added to the scene. Change-Id: Ieb42e37e545e4a39b58a3175a33b5441b4639404 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Don't use a slide's time value to update the component playerChristian Strømme2018-06-181-1/+1
| | | | | | | | | | The two time-lines are not necessarily synced up, or have the same duration, so when a component player is not playing, use the component players previous position to update the visibility of its nodes. Change-Id: Id959bd78e4d5ce9622001d47b1deff82c77780cb Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Sync the slide time from the parent with its component playersChristian Strømme2018-06-061-1/+1
| | | | | | | | This is needed to make sure the components objects are hidden at correctly at the right time. Change-Id: Id3898d1f4a90bd23386ff7b687c2bce743411653 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Fix mode setting on component playersChristian Strømme2018-06-061-1/+1
| | | | | | | | | Make sure we go through all component and their players, also just set the parent mode directly in the constructor for component players as we shouldn't need to go through the whole list each time. Change-Id: Iea0817fe540499d684fe0e15a415476c424558dc Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Fix visibility check for componentsChristian Strømme2018-06-061-1/+1
| | | | | | | | In the time update for component players we need to check if the component is visible in parent. Change-Id: I66d00e4f1cd0bdf56dbe8cd6e79068b2179a9cad Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Improve visibility updates and add effective visibility trackingv2.0.0-rcChristian Strømme2018-06-011-1/+2
| | | | | | | Fixes visibility for effects and layers. Change-Id: Ib0ed0f28145680171e3e78c49a68cc58332dad3b Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Move the slide position callback out of the animation classChristian Strømme2018-06-011-1/+1
| | | | | | | | | The callback for the time updates belongs to the slideplayer and also deserves a better name the "DummyCallback", so moved it into the slideplayer's source file and renamed it to Q3DSSlidePositionCallback. Change-Id: I073dfd59ef4f95f0c03b73205069ed5af7fb912b Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Fix eyeball updates for effectsChristian Strømme2018-05-231-1/+1
| | | | | | | | We need to update these the same way we do node types, which includes storing the rollback data to reset the values once the slide changes. Change-Id: I2f59a68d279d00c331ca63f29885c1b0552008a9 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Rollback the master slide's eyeball propertiesChristian Strømme2018-05-231-2/+1
| | | | | Change-Id: I111a0d538080e6f2b9d2f91402d7f730f6a41793 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Refactor handleSlideChange in the scene managerChristian Strømme2018-05-181-0/+2
| | | | | | | | | | Move the relevant code to the slide player, as the implementation details belongs there. Also, updating the properties are now done in-place and without extra heap alloctions, which should make the code more performant as well. Change-Id: I5cee4ee24a670faf0245d9fda4ad2a7a66734851 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Fix misc. component logicChristian Stromme2018-05-151-0/+1
| | | | | | | | | | Better handling of components. They live their own life, so don't try to enforce anything from the slide that owns the component, it will all be handled by the components slide player. Task-number: QT3DS-1016 Change-Id: If435d6d0799bd52caae133b48119e0a015ff34d0 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Remove queued update on EOSChristian Strømme2018-05-081-1/+1
| | | | | | | | This is no longer needed as the updates are not coming from the animator directly. Change-Id: I699978f4cdeea5932b46d82e85bd917a5c7129c9 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Add support for dynamic key-framesChristian Strømme2018-04-261-0/+1
| | | | | | Task-number: QT3DS-121 Change-Id: Iaadd36ed6024a328f73815394551c5a7ec32c576 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Add goToSlide variantsLaszlo Agocs2018-03-201-2/+10
| | | | | Change-Id: I7598a167b4c10a38b9e824189491e08271083c50 Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* Implement the concept of "preceding" slideLaszlo Agocs2018-03-161-1/+20
| | | | | | | | Which is not the same as previous, but rather a go back to whatever was current previously (with a 1 level history). Change-Id: Ie4cbb0d2bb49773bf622b14e61afd34eaa540fe9 Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* Fix bug where component and child objects on slidedeck were out of syncAdam Treat2018-03-141-1/+1
| | | | | | | | | When evaluating whether a node is visible, we have to take into account whether the node's parent if it is part of a component is itself visible. Change-Id: I06ee8a866db686b6ad709480030908657bb772b2 Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* Temporary fix for animations on objects unlinked from the scenegraphLaszlo Agocs2018-03-141-0/+2
| | | | | | | | This leads to leaking attached->animationData and the callback pointers in it. Needs a more sophisticated solution later. Change-Id: I7c6313efd0268b7f010392219abfca902dbcd6dd Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* Update node visibility based on starttime/endtimeAdam Treat2018-03-121-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Honor all items starttimes on initializing a slide to be shown Honor the starttime/endtime for components and refactor/consolidate code Refactors SlidePlayer so that the setSlideTime method can replace the updateSlideVisibility method. Consolidates the two methods for taking care to mark a slide and its children as visible/hidden. In addition, the patch honors the starttime/endtime properities for components. In order to do this it was necessary to change the SliderPlayer time API (seek, position, duration) to use milliseconds instead of a normalized range from 0 - 1. I've also fixed bugs with positionChanged signal so that it consistently emits only after the animation engine has registered the change and only when the position has actually changed. This required a small change to SlideExplorerWidget as well. Fixes slideplayer test to take into account changes to (seek, position, duration) indicated above and fixes a bug in the slideChanged signal that was not being captured before. Finally, I've added tests for component starttime/endtime visibility. Task-number: QT3DS-123 Change-Id: Iebc8c0a6365d6551aec70f76aacffd7c00cd8ac4 Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* Fix potential crash on application exitAdam Treat2018-03-081-3/+3
| | | | | | | | | | | | | A previous commit changed the object ownership of the AnimationManager class. The change did not result in a crash on exit, but that was by luck. The animation manager is a shared class between the slideplayer and its children. If the parent slideplayer deletes the animation manager and the children are then destructed it could cause a crash on exit in the future. This patch fixes it by sharing ownership of the AM by all slideplayers. Change-Id: Id9ae6b0459d035efc83b66befde089d0728cf19b Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* Minor clean-up of the slide deck and player codeChristian Strømme2018-03-071-12/+13
| | | | | | | | | | - Keep track of a component's parent slide in the slide deck. - Set the slide player on all slides attached data - we already allocate and drag the pointer for it around, so let's use it for something useful. Change-Id: Iefcc4e5cd171f397381686cbca00f699611d8447 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Make PlayThroughTo work when explicitly setting a slideChristian Strømme2018-03-071-3/+36
| | | | | | | | | | Previously we would assume PlayThroughTo would either be "next" or "previous". With this change it's also possible to set a value, which should either be an index, or an id to the slide to be played next. Task-number: QT3DS-405 Change-Id: I6a6aa2b4dd7a0592be818af0f3c15f24bb296a3d Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Change object ownership so that slideplayer owns animationmanagerAdam Treat2018-03-021-2/+3
| | | | | Change-Id: I330e4362051f1936746499c155298ec9d76d1062 Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* Add utility function for getting the start and end time for a slideChristian Strømme2018-02-271-0/+5
| | | | | | | | | | | Get the start and end time from the slide by looking at the parents layer. This assumes that the properties for the layer(s) has been updates before being called. If the parent doesn't have a layer, e.g., because it's a component, then we get the time by going through the the start and endtime of the slide's objects. Change-Id: Id8d2d134de3efd880ee5379b1316d5f1d3502f5a Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Fix handling of StopAtEnd in the slide playerChristian Strømme2018-02-191-1/+3
| | | | | | | | | | | | | | | The player made a distinction between "stopped" and "paused", assuming that stop meant that the animations would be reset to the starting point. This differs from how runtime 1.0 handles stop and StopAtEnd. In addition to stop having different meaning, we would not properly reset the animatables values to their initial values, as the values from seeking and the rollback values could be update in the wrong order, so we now do a forced reset when stop is called, to avoid getting stale values from Qt3d. Task-number: QT3DS-1145 Change-Id: I3c1cca6648faf3ede4bbed46189fe6bade4dff65 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Add slide playerChristian Strømme2018-02-141-0/+286
This adds logic for handling slides and their animations. Change-Id: I368d16fd2164dca41931ee2b566b16d5098a99ad Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>