summaryrefslogtreecommitdiffstats
path: root/src/animation/backend/blendedclipanimator_p.h
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Update commercial license headers"v5.15.3-lts-lgplTarja Sundqvist2021-03-231-19/+19
| | | | | | | | | | | This reverts commit 03e5f60e585701608c1181365faee484d7a1f14c. Revert of commercial license headers is required for Qt 5.15.3 opensource release. Task-number: QTBUG-91108 Change-Id: I359e89ed77b1b2750607617d138ebb6c316f0296 Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
* Update commercial license headersTarja Sundqvist2021-02-021-19/+19
| | | | | | | | | | | | | | | | Updated header.COMM to the files in tqtc-qt3d. Examples, documentation files or tests 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-4155 Change-Id: I139c8ad72c042b0900239decc36cfed4bc1c4951 Reviewed-by: Jukka Jokiniva <jukka.jokiniva@qt.io>
* Animations: prevent FindRunningClipAnimatorJob from running every framePaul Lemire2020-04-141-1/+1
| | | | | | | | | | | | | | | | | 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-3/+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>
* Update QBlendedClipAnimator to use direct syncMike Krus2019-09-201-2/+1
| | | | | Change-Id: I6b00f22196d29b5219e27e5084c379b69b68c6e5 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Add normalizedTime function to blendedlclip animatorsChristian Strømme2018-01-231-1/+14
| | | | | Change-Id: I19c1907371d9d131295558eb19c297d544ebef7d Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Merge remote-tracking branch 'origin/5.10' into devAndy Nichols2017-11-131-3/+10
|\ | | | | | | Change-Id: I2d373d538df3a65ac2d41238e5c6a214a151be68
| * Fix animation local time calculation when changing playbackRateJuan José Casafranca2017-10-061-3/+10
| | | | | | | | | | | | | | | | | | | | 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>
* | Replace Q_DECL_FINAL with finalKevin Funk2017-09-251-1/+1
| | | | | | | | | | Change-Id: Ia80d1cb9cc96d76f8b367caa725c59a70ae0a4d5 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Replace Q_DECL_OVERRIDE with overrideKevin Funk2017-09-251-1/+1
|/ | | | | Change-Id: I92c955068e233c50043ad7d06a32300dd386c24d Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Merge branch '5.9' into 5.10Sean Harmer2017-09-121-0/+2
|\ | | | | | | Change-Id: Id6a3d4ec579a2f2a2e559c22a2293d0e184f0bdf
| * Re-build Blend-Trees when Clips have been loadedWieland Hagen2017-09-081-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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/+3
| | | | | | | | | | | | | | | | | | 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/+1
|/ | | | | | | | 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>
* Remove some dead code related to old blend tree implementationSean Harmer2017-03-261-17/+1
| | | | | Change-Id: I597d41da76da06d5301304b54e8c0d5142d78a64 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Add storage for channel mappings to BlendedClipAnimatorSean Harmer2017-03-251-0/+4
| | | | | | | Needs populating in a job executed before any evaluations take place. Change-Id: I7507fd9c862603259808c14173c23177a41dbf14 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Add function to evaluate a blend treeSean Harmer2017-03-251-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Turns out with this design, evaluating the blend tree is actually really simple. Visit the tree nodes and call blend on the interior nodes. The leaf nodes will already have their values from an earlier stage. This also makes apparent yet another opportunity for parallelism during the blend tree evaluation. The blend tree may contain independent subtrees that can safely be evaluated in parallel. Once we have the ability for jobs to spawn jobs there are at least 3 ways we can have parallelism in the blend tree evaluation: 1) Each blended clip animator can be processed in its own job. 2) Sub trees of the blend tree can be evaluated in parallel, relying upon dependencies between jobs to do this properly. 3) Within each node's doBlend() there is potential to use a parallel implementation of the map operation like parallel_for in TBB. There are also other opportunities in earlier stages of processing such as when evaluating the actual clips, we then need a gather operation to map the clip results into the layout used by the blend tree. This evaluations could be done in parallel as well as a parallel gather (which is just a map with a random access read operation). This all bodes well for being able to process large numbers of animations each containing large numbers of channels which will be needed when we add support for skeletons. Change-Id: Id81e3a5e563a7ef9b7ac39b90c518c656cf8a3cf Reviewed-by: Paul Lemire <paul.lemire@kdab.com> 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>
* BlendedAnimations: allow nested blending nodes evaluationPaul Lemire2017-01-311-4/+17
| | | | | Change-Id: Ic6a70ee57f56dff7406b5917d620ea15b74ecb44 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Build blend trees and execute themPaul Lemire2017-01-291-0/+22
| | | | | | | | Also added loops property to the blendedclipanimator as mandated by rebase. Note: only handles LERP with single node for now Change-Id: I91e071467c604279262ec04288bc7f8b2b19f4a1 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Completed BlenderAnimator frontend and backendPaul Lemire2017-01-291-1/+11
| | | | | Change-Id: I5d463467811afe6245b278a1b277ec20159d3440 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Add a job to load animation clipsSean Harmer2017-01-271-6/+2
| | | | | | | | | | | 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/+83
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>