mirror of
https://github.com/overte-org/overte.git
synced 2025-07-28 21:50:24 +02:00
Added script to disable avatar animations, but not IK.
This commit is contained in:
parent
1682598be7
commit
f15bc7b99a
1 changed files with 38 additions and 0 deletions
38
examples/disableAvatarAnimations.js
Normal file
38
examples/disableAvatarAnimations.js
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
|
||||||
|
var skeletonModelURL = "";
|
||||||
|
var jointCount = 0;
|
||||||
|
|
||||||
|
var excludedRoles = ["rightHandGraspOpen", "rightHandGraspClosed", "leftHandGraspOpen", "leftHandGraspClosed"];
|
||||||
|
var IDLE_URL = "http://hifi-content.s3.amazonaws.com/ozan/dev/anim/standard_anims_160127/idle.fbx";
|
||||||
|
|
||||||
|
function overrideAnims() {
|
||||||
|
var roles = MyAvatar.getAnimationRoles();
|
||||||
|
var i, l = roles.length;
|
||||||
|
for (i = 0; i < l; i++) {
|
||||||
|
if (excludedRoles.indexOf(roles[i]) == -1) {
|
||||||
|
MyAvatar.overrideRoleAnimation(roles[i], IDLE_URL, 30, false, 1, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function restoreAnims() {
|
||||||
|
var roles = MyAvatar.getAnimationRoles();
|
||||||
|
var i, l = roles.length;
|
||||||
|
for (i = 0; i < l; i++) {
|
||||||
|
if (excludedRoles.indexOf(roles[i]) == -1) {
|
||||||
|
MyAvatar.restoreRoleAnimation(roles[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
overrideAnims();
|
||||||
|
|
||||||
|
MyAvatar.onLoadComplete.connect(function () {
|
||||||
|
overrideAnims();
|
||||||
|
});
|
||||||
|
|
||||||
|
Script.scriptEnding.connect(function () {
|
||||||
|
restoreAnims();
|
||||||
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue