mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 14:03:55 +02:00
MyAvatar: removed priority, hold and maskedJoints from playAnimation js call
This commit is contained in:
parent
a0f21228f6
commit
af2b3bb9d5
5 changed files with 13 additions and 19 deletions
|
@ -53,13 +53,11 @@ function kneelDown() {
|
|||
kneeling = true;
|
||||
|
||||
var playbackRate = 30; // 30 fps is normal speed.
|
||||
var priority = 0; // obsolete
|
||||
var loopFlag = false;
|
||||
var holdFlag = false; // obsolete
|
||||
var startFrame = 0;
|
||||
var endFrame = 82;
|
||||
var maskedJoints = []; // obsolete
|
||||
MyAvatar.startAnimation(KNEEL_ANIM_URL, playbackRate, priority, loopFlag, holdFlag, startFrame, endFrame, maskedJoints);
|
||||
|
||||
MyAvatar.startAnimation(KNEEL_ANIM_URL, playbackRate, loopFlag, startFrame, endFrame);
|
||||
|
||||
Overlays.editOverlay(kneelDownButton, { visible: false });
|
||||
Overlays.editOverlay(standUpButton, { visible: true });
|
||||
|
|
|
@ -657,15 +657,13 @@ void MyAvatar::loadLastRecording() {
|
|||
_player->loadRecording(_recorder->getRecording());
|
||||
}
|
||||
|
||||
void MyAvatar::startAnimation(const QString& url, float fps, float priority,
|
||||
bool loop, bool hold, float firstFrame, float lastFrame, const QStringList& maskedJoints) {
|
||||
void MyAvatar::startAnimation(const QString& url, float fps, bool loop, float firstFrame, float lastFrame) {
|
||||
if (QThread::currentThread() != thread()) {
|
||||
QMetaObject::invokeMethod(this, "startAnimation", Q_ARG(const QString&, url), Q_ARG(float, fps),
|
||||
Q_ARG(float, priority), Q_ARG(bool, loop), Q_ARG(bool, hold), Q_ARG(float, firstFrame),
|
||||
Q_ARG(float, lastFrame), Q_ARG(const QStringList&, maskedJoints));
|
||||
Q_ARG(bool, loop), Q_ARG(float, firstFrame), Q_ARG(float, lastFrame));
|
||||
return;
|
||||
}
|
||||
_rig->startAnimation(url, fps, priority, loop, hold, firstFrame, lastFrame, maskedJoints);
|
||||
_rig->startAnimation(url, fps, loop, firstFrame, lastFrame);
|
||||
}
|
||||
|
||||
void MyAvatar::startAnimationByRole(const QString& role, const QString& url, float fps, float priority,
|
||||
|
|
|
@ -118,9 +118,7 @@ public:
|
|||
AnimationHandlePointer addAnimationHandle() { return _rig->createAnimationHandle(); }
|
||||
void removeAnimationHandle(const AnimationHandlePointer& handle) { _rig->removeAnimationHandle(handle); }
|
||||
/// Allows scripts to run animations.
|
||||
Q_INVOKABLE void startAnimation(const QString& url, float fps = 30.0f, float priority = 1.0f, bool loop = false,
|
||||
bool hold = false, float firstFrame = 0.0f,
|
||||
float lastFrame = FLT_MAX, const QStringList& maskedJoints = QStringList());
|
||||
Q_INVOKABLE void startAnimation(const QString& url, float fps, bool loop, float firstFrame, float lastFrame);
|
||||
|
||||
/// Stops an animation as identified by a URL.
|
||||
Q_INVOKABLE void stopAnimation(const QString& url);
|
||||
|
|
|
@ -45,13 +45,9 @@ void Rig::removeAnimationHandle(const AnimationHandlePointer& handle) {
|
|||
_animationHandles.removeOne(handle);
|
||||
}
|
||||
|
||||
void Rig::startAnimation(const QString& url, float fps, float priority,
|
||||
bool loop, bool hold, float firstFrame, float lastFrame, const QStringList& maskedJoints) {
|
||||
void Rig::startAnimation(const QString& url, float fps, bool loop, float firstFrame, float lastFrame) {
|
||||
if (_enableAnimGraph) {
|
||||
|
||||
// NOTE: mask joints are unsupported, priority is now meaningless, hold flag is essentially always true
|
||||
// when using the AnimGraph system.
|
||||
|
||||
// find an unused AnimClip clipNode
|
||||
std::shared_ptr<AnimClip> clip;
|
||||
if (_userAnimState == UserAnimState::None || _userAnimState == UserAnimState::B) {
|
||||
|
@ -79,6 +75,10 @@ void Rig::startAnimation(const QString& url, float fps, float priority,
|
|||
|
||||
} else {
|
||||
|
||||
float priority = 1.0f;
|
||||
bool hold = true;
|
||||
QStringList 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;
|
||||
|
@ -105,6 +105,7 @@ void Rig::startAnimation(const QString& url, float fps, float priority,
|
|||
|
||||
AnimationHandlePointer Rig::addAnimationByRole(const QString& role, const QString& url, float fps, float priority,
|
||||
bool loop, bool hold, float firstFrame, float lastFrame, const QStringList& maskedJoints, bool startAutomatically) {
|
||||
|
||||
// check for a configured animation for the role
|
||||
//qCDebug(animation) << "addAnimationByRole" << role << url << fps << priority << loop << hold << firstFrame << lastFrame << maskedJoints << startAutomatically;
|
||||
foreach (const AnimationHandlePointer& candidate, _animationHandles) {
|
||||
|
|
|
@ -113,8 +113,7 @@ public:
|
|||
void deleteAnimations();
|
||||
void destroyAnimGraph();
|
||||
const QList<AnimationHandlePointer>& getAnimationHandles() const { return _animationHandles; }
|
||||
void startAnimation(const QString& url, float fps = 30.0f, float priority = 1.0f, bool loop = false,
|
||||
bool hold = false, float firstFrame = 0.0f, float lastFrame = FLT_MAX, const QStringList& maskedJoints = QStringList());
|
||||
void startAnimation(const QString& url, float fps, bool loop, float firstFrame, float lastFrame);
|
||||
void stopAnimation(const QString& url);
|
||||
void startAnimationByRole(const QString& role, const QString& url = QString(), float fps = 30.0f,
|
||||
float priority = 1.0f, bool loop = false, bool hold = false, float firstFrame = 0.0f,
|
||||
|
|
Loading…
Reference in a new issue