summaryrefslogtreecommitdiffstats
path: root/src/animation/backend/clipanimator.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Update commercial license headers"Tarja Sundqvist2022-11-241-21/+21
| | | | | | | | | | | This reverts commit be52033d3074773e313ed5522c7aa51625f95604. Revert of commercial license headers is required for the Qt 6.2.x opensource releases, Qt 6.2.5 onwards. Task-number: QTBUG-107760 Change-Id: I2160e3269e8652cec427b3d82f540b0a07f789d7 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Update commercial license headersTarja Sundqvist2022-06-131-21/+21
| | | | | | | | | | | | | | | Updated header.COMM to the files in tqtc-qt3d. Examples, tests, or documentation files are not updated. The commercial license header may contain some additional lines so that its line count equals with the earlier license header. Reason for this is that some autotests use hard coded line numbers and a change in the line count causes failures in tests. Task-number: QTQAINFRA-4935 Change-Id: I769e2e6a9afe8a340fb04ae002cd37a3b356c701 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Reset ClipAnimator loop counter on cleanupMauro Persano2021-09-291-0/+1
| | | | | | | | | | Otherwise, if a backend node with a loop counter larger than 1 is reused for a non-looping animation, the animation won't get played. Change-Id: I5b043b9c844bba9b04edc5db383bdf0e3b92fe87 Reviewed-by: Sean Harmer <sean.harmer@kdab.com> (cherry picked from commit 185dd8b27457a40cafa72ad77ead642487e4648b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Replace QT_BEGIN_LICENSE:LGPL3 headerKai Köhne2021-08-101-10/+13
| | | | | | | | | | | Replace outdated LGPL3 with LGPL header in src, and GPL3-EXCEPT in tests. Task-number: QTBUG-90321 Change-Id: I3f6491cb402a993a4341a983c780337e8658c256 Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io> (cherry picked from commit cd9de7b9b5d870d5a52d59b58878564308ecb10d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Animations: prevent FindRunningClipAnimatorJob from running every framePaul Lemire2020-04-141-2/+2
| | | | | | | | | | | | | | | | | The job it does takes a fair amount of time and only needs to run occasionally. We would reset the normalized time on the backend node every frame which then lead to a dirty set being set when synching again with the frontend. This might not have happened every frame prior to the synching refactorings. However currently, after every animation step, the dirty set would be reset and the job scheduled to run again even though nothing had really changed. This patch fixes that by setting the normalized time on the backend node prior to the synching with the frontend. That way, when we sync with the frontend the values are either identical when playing the animation unless the user really has changed the normalizedTime value. Change-Id: Iade4e7bfd47d34ef083d8e3398180a71630c0c81 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Update animation evaluation jobs to use direct syncMike Krus2019-10-081-22/+0
| | | | | | | | | | | | | | Animation data is now stored in the job which propagates them to the frontend at the end of the frame. Animated properties are passed using Qt's property system. Animated poses are passed via the frontend skeleton node. Syncing on new frame will take care of propagating both for use in other aspects. Callbacks are called by the job directly or stored and invoked on the main thread depending on the callback setting. Change-Id: I78675715799300bc1b27f854f1a445c00a2ac734 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Clean up includesMike Krus2019-10-011-2/+0
| | | | | | | | | Remove include statements for classes that are no longer used. Makes it easier to find remaining use cases that need addressed before complete removal in Qt 6. Change-Id: I60529ba1929ad64b162d3847d5df47cde2a60dad Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Update QClipAnimator to use direct syncMike Krus2019-09-201-35/+26
| | | | | Change-Id: I33cd39df0762a54c7d1beb74b57fd804bb2ae3e9 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Add support for setting a time index in the ClipAnimatorChristian Strømme2018-01-231-0/+18
| | | | | | | | | This makes it possible to seek the animation clip to a specific position in the time-line. The index is a real value between 0 and 1, where 0.0 is the start of the clip and 1.0 is at the end of the clip Change-Id: Ic8c57d04e4f1e0a7628713e057b5b8a41a400c5a Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Wrap up the format describing source clip and formatted resultsSean Harmer2018-01-181-1/+1
| | | | | | | | | | | | | | | | | | | | We need more information that just the source indices to be able to properly describe the transformation from the raw evaluation results of a clip, through to the formatted layout later consumed by the MappingData objects. The playback of a QClipAnimator still works but it seems that the process for properly blending animations is more complicated than previously thought. We cannot simply assume a default value of 0 for all channel components. If a clip has a channel missing but the user has still requested that this channel be evaluated (by way of a mapping or a subset of clips having matching channel data), then we must provide sensible defaults for those channel components. This deficiency will be dealt with in a following commit. Change-Id: I7d7d0f7ce19c545629bb347e1132fc4ed6a59d0d Reviewed-by: Christian Stromme <christian.stromme@qt.io> Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Fix animation local time calculation when changing playbackRateJuan José Casafranca2017-10-061-1/+22
| | | | | | | | | | Animation local time was computed in absolute mode, as a scale of the global time that has passed since the start of the animation. Now is computed relative to the last local time, as the last local time + a scale of the elapsed global time. Change-Id: I5c29002602a5184174618ac7755ec94f5c7a328f Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Merge branch '5.9' into 5.10Sean Harmer2017-09-301-0/+1
|\ | | | | | | | | | | | | | | | | | | Conflicts: src/animation/backend/animationutils.cpp src/animation/backend/animationutils_p.h src/render/geometry/qmesh.cpp tests/auto/animation/animation.pro Change-Id: Ifb57bfb0b12b3ebf9ee177d4ea684134455b4143
| * Move the non-blended animation codepath closer to the blended oneSean Harmer2017-09-291-0/+1
| | | | | | | | | | | | | | | | | | Will make it possible to reduce the amount of code to maintain and test. There are still several ways to optimize this too so best to only do it for one code path that all animators use. Change-Id: I05ebd4f41d88aa0bea37d4d17130bc79c96ebd5c Reviewed-by: Sérgio Martins <sergio.martins@kdab.com>
* | Merge branch '5.9' into 5.10Sean Harmer2017-09-121-0/+5
|\| | | | | | | Change-Id: Id6a3d4ec579a2f2a2e559c22a2293d0e184f0bdf
| * Re-build Blend-Trees when Clips have been loadedWieland Hagen2017-09-081-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We need to notify the BlendedClipAnimators, when any of the clips it depends on have been loaded. So we register each animator at the clips that it depends on, mark the animator dirty when the clip has been loaded and thus trigger a re-run of the BuildBlendTreesJob. Make sure to guard accesses to the Handler via mutexes, because backend objects can be marked dirty from various threads. Task-number: QTBUG-61941 Change-Id: I4890d0d76d3118538537252f920d9477bed8f934 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Add clock property to QAbstractClipAnimatorChip Collier2017-07-241-0/+11
| | | | | | | | | | | | | | | | | | Introduces "clock" property to QAbstractClipAnimator and updates associated tests. Updated backend animator nodes and associated evaluation jobs. Change-Id: Id18cabdd710b9b7253772642f21f63043d316a42 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Add support for animation callbacksLaszlo Agocs2017-06-231-0/+16
|/ | | | | | | | Let QChannelMapping optionally specify a callback, which then gets invoked either directly on a worker thread or the gui thread. Change-Id: I871776f47cc921ceb254f9dc1a7b89ae5c5618d8 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Rename AnimationClipLoader to AnimationClipSean Harmer2017-04-121-1/+1
| | | | | | | | It handles both loadign from file and from data constructed using the public API. Change-Id: Ic9e71dc60c36869548323312f7129df6c9edd763 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Pass argument by reference and make trivial function inlineSean Harmer2017-03-251-5/+0
| | | | | Change-Id: Ifc6897cea2f599b20bea82b00adfddbac5cc8e7f Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Remove AnimationUtils classSean Harmer2017-03-061-1/+1
| | | | | | | | | It was stateless, so make the static member functions free functions and export them for auto tests. We're already in the Qt3DAnimation::Animation namespace so this removes some visual clutter. Change-Id: I4e1a72c47d5bd4afb807ce5f6dc80dc0ce4bb213 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Introduce QAbstractAnimationClip and rename QAnimationClipSean Harmer2017-02-241-1/+1
| | | | | | | | | | | | | Introduced an abstract base class for types of animation clip. Also renamed QAnimationClip to QAnimationClipLoader since it loads data from files. Also renamed corresponding backend type and fixed up unit tests accordingly. Task-number: QTBUG-58898 Change-Id: I01a96e108cbbcd12e01913693e96610598965018 Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
* Refactor clip evaluation and property mappingPaul Lemire2017-01-291-281/+6
| | | | | | | Ass this will be reused by the blend tree animator Change-Id: I61ef91b74e91778f380f794ba221f56761129cfa Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Add loops property to ClipAnimator and implement logic for itSean Harmer2017-01-291-4/+31
| | | | | Change-Id: Ied67635f202e01c626177b4869b77db5bd3e80d4 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Add job to process running clip animatorsSean Harmer2017-01-271-1/+274
| | | | | | | | | | Introduces more logic to QNode::sceneChangeEvent to set properties being animated without every QNode subclass needing to override it. We can like do a follow up commit that removes some such overrides. Change-Id: I2a96e0929b2fbd39ca3866908fee11c842bede42 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Add job to find all clip animators that should be runningSean Harmer2017-01-271-2/+10
| | | | | Change-Id: I198a5d0d198c56756e4ac045527e02969b4dcecb Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Add channelMapper property to QClipAnimatorSean Harmer2017-01-271-0/+10
| | | | | Change-Id: I50a07e51188ae31f58e57d1baf98e22792ce88db Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Add running property to QClipAnimatorSean Harmer2017-01-271-0/+11
| | | | | Change-Id: I5ef29ada7fd6584674d98162f7106177e199b720 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Add a job to load animation clipsSean Harmer2017-01-271-2/+1
| | | | | | | | | | | Defers the actual work to AnimationClip. Also made all backend nodes have a common base class to make it easy to track the Handler. Added a manual test to exercise this and which we can build up over time as we add API. Change-Id: I7cdd8da948498544059ba51efe38642dd54ea410 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Add animation componentsSean Harmer2017-01-271-0/+87
Three levels of animation playback are available at present for keyframe animation: 1) Direct playback of a clip via QClipAnimator 2) Playback of a blend tree of clips via QBlendedClipAnimator 3) Playback of a set of blend trees controlled with a state machine via QConductedClipAnimator This commit adds the frontend and backend nodes for all 3 components and registers them. The blended and conducted animator components are just empty skeletons for now. Change-Id: If2f0a912c003f3d20f830a8f6174946eea6b47e6 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>