mirror of
https://github.com/overte-org/community-apps.git
synced 2025-04-07 02:22:35 +02:00
Disable procedural eye blinking when face tracking is running
This commit is contained in:
parent
fab88f5524
commit
49fadc5634
1 changed files with 11 additions and 13 deletions
|
@ -33,7 +33,9 @@ var webWindow;
|
|||
var yaw = 0;
|
||||
var roll = 0;
|
||||
var headTransform = null;
|
||||
var lastDataArrived = Date.now();
|
||||
var lastDataArrived = Date.now() - 3000;
|
||||
// Caching this value is a good idea because API calls are expensive
|
||||
var isProceduralblinkingEnabled = true;
|
||||
|
||||
button = tablet.addButton({
|
||||
icon: ROOT + "images/face.png",
|
||||
|
@ -84,11 +86,19 @@ var webWindow;
|
|||
var propList = ["headRotation", "headType"];
|
||||
handlerId = MyAvatar.addAnimationStateHandler(function (props) {
|
||||
if (Date.now() - lastDataArrived < 2000) {
|
||||
if (isProceduralblinkingEnabled) {
|
||||
MyAvatar.hasProceduralBlinkFaceMovement = false;
|
||||
isProceduralblinkingEnabled = false;
|
||||
}
|
||||
return {
|
||||
headRotation: headTransform,
|
||||
headType: 4
|
||||
};
|
||||
} else {
|
||||
if (!isProceduralblinkingEnabled) {
|
||||
MyAvatar.hasProceduralBlinkFaceMovement = true;
|
||||
isProceduralblinkingEnabled = true;
|
||||
}
|
||||
return props;
|
||||
}
|
||||
}, propList);
|
||||
|
@ -222,18 +232,6 @@ var webWindow;
|
|||
}
|
||||
}
|
||||
|
||||
function setEmotion(currentEmotion) {
|
||||
if (emotion !== lastEmotionUsed) {
|
||||
lastEmotionUsed = emotion;
|
||||
}
|
||||
if (currentEmotion !== lastEmotionUsed) {
|
||||
changingEmotionPercentage = 0.0;
|
||||
emotion = currentEmotion;
|
||||
isChangingEmotion = true;
|
||||
MyAvatar.hasScriptedBlendshapes = true;
|
||||
}
|
||||
}
|
||||
|
||||
function onWindowClosed() {
|
||||
webWindow = null;
|
||||
button.editProperties({isActive: false});
|
||||
|
|
Loading…
Reference in a new issue