mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 16:14:35 +02:00
For startAnimation (but not startAnimationByRole), use the specified parameters even if the animation
was already playing. This fixes the behavior exercised by the squeezeHands.js script. Fixes https://app.asana.com/0/32622044445063/44025709513292
This commit is contained in:
parent
3f5f75d6d2
commit
61afc362e7
1 changed files with 8 additions and 5 deletions
|
@ -58,15 +58,18 @@ void Rig::removeAnimationHandle(const AnimationHandlePointer& handle) {
|
||||||
|
|
||||||
void Rig::startAnimation(const QString& url, float fps, float priority,
|
void Rig::startAnimation(const QString& url, float fps, float priority,
|
||||||
bool loop, bool hold, float firstFrame, float lastFrame, const QStringList& maskedJoints) {
|
bool loop, bool hold, float firstFrame, float lastFrame, const QStringList& maskedJoints) {
|
||||||
//qCDebug(animation) << "startAnimation" << url << fps << priority << loop << hold << firstFrame << lastFrame << maskedJoints;
|
// This is different than startAnimationByRole, in which we use the existing values if the animation already exists.
|
||||||
|
// Here we reuse the animation handle if possible, but in any case, we set the values to those given (or defaulted).
|
||||||
|
AnimationHandlePointer handle = nullptr;
|
||||||
foreach (const AnimationHandlePointer& candidate, _animationHandles) {
|
foreach (const AnimationHandlePointer& candidate, _animationHandles) {
|
||||||
if (candidate->getURL() == url) {
|
if (candidate->getURL() == url) {
|
||||||
candidate->start();
|
handle = candidate;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
AnimationHandlePointer handle = createAnimationHandle();
|
if (!handle) {
|
||||||
|
handle = createAnimationHandle();
|
||||||
handle->setURL(url);
|
handle->setURL(url);
|
||||||
|
}
|
||||||
handle->setFPS(fps);
|
handle->setFPS(fps);
|
||||||
handle->setPriority(priority);
|
handle->setPriority(priority);
|
||||||
handle->setLoop(loop);
|
handle->setLoop(loop);
|
||||||
|
|
Loading…
Reference in a new issue