mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-07 19:23:04 +02:00
Tweak transit animation
This commit is contained in:
parent
f9b6d3dc6f
commit
6ed6e30df3
4 changed files with 13 additions and 71 deletions
BIN
interface/resources/avatar/animations/teleport.fbx
Normal file
BIN
interface/resources/avatar/animations/teleport.fbx
Normal file
Binary file not shown.
|
@ -53,8 +53,8 @@
|
|||
},
|
||||
{
|
||||
"id": "preTransitAnim",
|
||||
"interpTarget": 6,
|
||||
"interpDuration": 6,
|
||||
"interpTarget": 4,
|
||||
"interpDuration": 4,
|
||||
"transitions": [
|
||||
{ "var": "idleAnim", "state": "idleAnim" },
|
||||
{ "var": "transitAnim", "state": "transitAnim" }
|
||||
|
@ -62,8 +62,8 @@
|
|||
},
|
||||
{
|
||||
"id": "transitAnim",
|
||||
"interpTarget": 6,
|
||||
"interpDuration": 6,
|
||||
"interpTarget": 2,
|
||||
"interpDuration": 2,
|
||||
"transitions": [
|
||||
{ "var": "preTransitAnim", "state": "preTransitAnim" },
|
||||
{ "var": "postTransitAnim", "state": "postTransitAnim" }
|
||||
|
@ -71,8 +71,8 @@
|
|||
},
|
||||
{
|
||||
"id": "postTransitAnim",
|
||||
"interpTarget": 6,
|
||||
"interpDuration": 6,
|
||||
"interpTarget": 4,
|
||||
"interpDuration": 4,
|
||||
"transitions": [
|
||||
{ "var": "transitAnim", "state": "transitAnim" },
|
||||
{ "var": "idleAnim", "state": "idleAnim" }
|
||||
|
@ -97,7 +97,7 @@
|
|||
"id": "preTransitAnim",
|
||||
"type": "clip",
|
||||
"data": {
|
||||
"url": "https://hifi-content.s3.amazonaws.com/luis/test_scripts/transitApp/animations/teleport01_warp.fbx",
|
||||
"url": "qrc:///avatar/animations/teleport.fbx",
|
||||
"startFrame": 0.0,
|
||||
"endFrame": 10.0,
|
||||
"timeScale": 1.0,
|
||||
|
@ -109,11 +109,11 @@
|
|||
"id": "transitAnim",
|
||||
"type": "clip",
|
||||
"data": {
|
||||
"url": "https://hifi-content.s3.amazonaws.com/luis/test_scripts/transitApp/animations/teleport01_warp.fbx",
|
||||
"url": "qrc:///avatar/animations/teleport.fbx",
|
||||
"startFrame": 11.0,
|
||||
"endFrame": 11.0,
|
||||
"endFrame": 18.0,
|
||||
"timeScale": 1.0,
|
||||
"loopFlag": true
|
||||
"loopFlag": false
|
||||
},
|
||||
"children": []
|
||||
},
|
||||
|
@ -121,9 +121,9 @@
|
|||
"id": "postTransitAnim",
|
||||
"type": "clip",
|
||||
"data": {
|
||||
"url": "https://hifi-content.s3.amazonaws.com/luis/test_scripts/transitApp/animations/teleport01_warp.fbx",
|
||||
"startFrame": 22.0,
|
||||
"endFrame": 49.0,
|
||||
"url": "qrc:///avatar/animations/teleport.fbx",
|
||||
"startFrame": 19.0,
|
||||
"endFrame": 44.0,
|
||||
"timeScale": 1.0,
|
||||
"loopFlag": false
|
||||
},
|
||||
|
|
|
@ -1252,15 +1252,6 @@ void MyAvatar::overrideAnimation(const QString& url, float fps, bool loop, float
|
|||
_skeletonModel->getRig().overrideAnimation(url, fps, loop, firstFrame, lastFrame);
|
||||
}
|
||||
|
||||
void MyAvatar::overrideNetworkAnimation(const QString& url, float fps, bool loop, float firstFrame, float lastFrame) {
|
||||
if (QThread::currentThread() != thread()) {
|
||||
QMetaObject::invokeMethod(this, "overrideNetworkAnimation", Q_ARG(const QString&, url), Q_ARG(float, fps),
|
||||
Q_ARG(bool, loop), Q_ARG(float, firstFrame), Q_ARG(float, lastFrame));
|
||||
return;
|
||||
}
|
||||
_skeletonModel->getRig().overrideNetworkAnimation(url, fps, loop, firstFrame, lastFrame);
|
||||
}
|
||||
|
||||
void MyAvatar::restoreAnimation() {
|
||||
if (QThread::currentThread() != thread()) {
|
||||
QMetaObject::invokeMethod(this, "restoreAnimation");
|
||||
|
@ -1269,14 +1260,6 @@ void MyAvatar::restoreAnimation() {
|
|||
_skeletonModel->getRig().restoreAnimation();
|
||||
}
|
||||
|
||||
void MyAvatar::restoreNetworkAnimation() {
|
||||
if (QThread::currentThread() != thread()) {
|
||||
QMetaObject::invokeMethod(this, "restoreNetworkAnimation");
|
||||
return;
|
||||
}
|
||||
_skeletonModel->getRig().restoreNetworkAnimation();
|
||||
}
|
||||
|
||||
QStringList MyAvatar::getAnimationRoles() {
|
||||
if (QThread::currentThread() != thread()) {
|
||||
QStringList result;
|
||||
|
|
|
@ -406,47 +406,6 @@ public:
|
|||
*/
|
||||
Q_INVOKABLE void restoreAnimation();
|
||||
|
||||
/**jsdoc
|
||||
* Similarly to {@link MyAvatar.overrideAnimation}, this function will override the default avatar animations,
|
||||
* but only affecting the data the gets sent to other clients over the network. In the client, the avatar will move according
|
||||
* to the default animations but other clients will render your avatar movements according to the new animation.
|
||||
* To continue sending the default animations, use {@link MyAvatar.restoreNetworkAnimation}.<br />
|
||||
* <p>Note: When using pre-built animation data, it's critical that the joint orientation of the source animation and target
|
||||
* rig are equivalent, since the animation data applies absolute values onto the joints. If the orientations are different,
|
||||
* the avatar will move in unpredictable ways. For more information about avatar joint orientation standards, see
|
||||
* <a href="https://docs.highfidelity.com/create-and-explore/avatars/avatar-standards">Avatar Standards</a>.</p>
|
||||
* @function MyAvatar.overrideNetworkAnimation
|
||||
* @param url {string} The URL to the animation file. Animation files need to be .FBX format, but only need to contain the
|
||||
* avatar skeleton and animation data.
|
||||
* @param fps {number} The frames per second (FPS) rate for the animation playback. 30 FPS is normal speed.
|
||||
* @param loop {boolean} Set to true if the animation should loop.
|
||||
* @param firstFrame {number} The frame the animation should start at.
|
||||
* @param lastFrame {number} The frame the animation should end at.
|
||||
* @example <caption> Make your avatar clap only on other clients for three seconds. </caption>
|
||||
* // Clap your hands for 3 seconds then restore animation back to the avatar.
|
||||
* var ANIM_URL = "https://s3.amazonaws.com/hifi-public/animations/ClapAnimations/ClapHands_Standing.fbx";
|
||||
* MyAvatar.overrideNetworkAnimation(ANIM_URL, 30, true, 0, 53);
|
||||
* Script.setTimeout(function () {
|
||||
* MyAvatar.restoreNetworkAnimation();
|
||||
* }, 3000);
|
||||
*/
|
||||
Q_INVOKABLE void overrideNetworkAnimation(const QString& url, float fps, bool loop, float firstFrame, float lastFrame);
|
||||
|
||||
/**jsdoc
|
||||
* Similarly to {@link MyAvatar.restoreAnimation} restoreNetworkAnimation() will restore any network animation
|
||||
* that was previously overriten using the function {@link MyAvatar.overrideNetworkAnimation}
|
||||
* If you aren't currently playing an override network animation, this function will have no effect.
|
||||
* @function MyAvatar.restoreNetworkAnimation
|
||||
* @example <caption> Make your avatar clap only on other clients for three seconds. </caption>
|
||||
* // Clap your hands for 3 seconds then restore animation back to the avatar.
|
||||
* var ANIM_URL = "https://s3.amazonaws.com/hifi-public/animations/ClapAnimations/ClapHands_Standing.fbx";
|
||||
* MyAvatar.overrideNetworkAnimation(ANIM_URL, 30, true, 0, 53);
|
||||
* Script.setTimeout(function () {
|
||||
* MyAvatar.restoreNetworkAnimation();
|
||||
* }, 3000);
|
||||
*/
|
||||
Q_INVOKABLE void restoreNetworkAnimation();
|
||||
|
||||
/**jsdoc
|
||||
* Each avatar has an avatar-animation.json file that defines which animations are used and how they are blended together with procedural data
|
||||
* (such as look at vectors, hand sensors etc.). Each animation specified in the avatar-animation.json file is known as an animation role.
|
||||
|
|
Loading…
Reference in a new issue