mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-07 21:42:31 +02:00
input action channels for eyes and eyelids and fingers. connect eyelid input actions to blendshapes.
This commit is contained in:
parent
7fa24efca0
commit
943348ba51
6 changed files with 93 additions and 14 deletions
|
@ -162,7 +162,14 @@
|
|||
{ "from": "Standard.Head", "to": "Actions.Head" },
|
||||
{ "from": "Standard.LeftArm", "to": "Actions.LeftArm" },
|
||||
{ "from": "Standard.RightArm", "to": "Actions.RightArm" },
|
||||
|
||||
|
||||
{ "from": "Standard.LeftEye", "to": "Actions.LeftEye" },
|
||||
{ "from": "Standard.RightEye", "to": "Actions.RightEye" },
|
||||
|
||||
{ "from": "Standard.LeftEyeBlink", "to": "Actions.LeftEyeBlink" },
|
||||
{ "from": "Standard.RightEyeBlink", "to": "Actions.RightEyeBlink" },
|
||||
|
||||
|
||||
{ "from": "Standard.TrackedObject00", "to" : "Actions.TrackedObject00" },
|
||||
{ "from": "Standard.TrackedObject01", "to" : "Actions.TrackedObject01" },
|
||||
{ "from": "Standard.TrackedObject02", "to" : "Actions.TrackedObject02" },
|
||||
|
|
|
@ -57,7 +57,13 @@
|
|||
{ "from": "Standard.Head", "to": "Actions.Head" },
|
||||
{ "from": "Standard.LeftArm", "to": "Actions.LeftArm" },
|
||||
{ "from": "Standard.RightArm", "to": "Actions.RightArm" },
|
||||
|
||||
|
||||
{ "from": "Standard.LeftEye", "to": "Actions.LeftEye" },
|
||||
{ "from": "Standard.RightEye", "to": "Actions.RightEye" },
|
||||
|
||||
{ "from": "Standard.LeftEyeBlink", "to": "Actions.LeftEyeBlink" },
|
||||
{ "from": "Standard.RightEyeBlink", "to": "Actions.RightEyeBlink" },
|
||||
|
||||
{ "from": "Standard.TrackedObject00", "to" : "Actions.TrackedObject00" },
|
||||
{ "from": "Standard.TrackedObject01", "to" : "Actions.TrackedObject01" },
|
||||
{ "from": "Standard.TrackedObject02", "to" : "Actions.TrackedObject02" },
|
||||
|
|
|
@ -54,8 +54,52 @@
|
|||
{ "from": "Vive.RightApplicationMenu", "to": "Standard.RightSecondaryThumb" },
|
||||
|
||||
{ "from": "Vive.LeftHand", "to": "Standard.LeftHand" },
|
||||
{ "from": "Vive.LeftHandThumb1", "to": "Standard.LeftHandThumb1"},
|
||||
{ "from": "Vive.LeftHandThumb2", "to": "Standard.LeftHandThumb2"},
|
||||
{ "from": "Vive.LeftHandThumb3", "to": "Standard.LeftHandThumb3"},
|
||||
{ "from": "Vive.LeftHandThumb4", "to": "Standard.LeftHandThumb4"},
|
||||
{ "from": "Vive.LeftHandIndex1", "to": "Standard.LeftHandIndex1"},
|
||||
{ "from": "Vive.LeftHandIndex2", "to": "Standard.LeftHandIndex2"},
|
||||
{ "from": "Vive.LeftHandIndex3", "to": "Standard.LeftHandIndex3"},
|
||||
{ "from": "Vive.LeftHandIndex4", "to": "Standard.LeftHandIndex4"},
|
||||
{ "from": "Vive.LeftHandMiddle1", "to": "Standard.LeftHandMiddle1"},
|
||||
{ "from": "Vive.LeftHandMiddle2", "to": "Standard.LeftHandMiddle2"},
|
||||
{ "from": "Vive.LeftHandMiddle3", "to": "Standard.LeftHandMiddle3"},
|
||||
{ "from": "Vive.LeftHandMiddle4", "to": "Standard.LeftHandMiddle4"},
|
||||
{ "from": "Vive.LeftHandRing1", "to": "Standard.LeftHandRing1"},
|
||||
{ "from": "Vive.LeftHandRing2", "to": "Standard.LeftHandRing2"},
|
||||
{ "from": "Vive.LeftHandRing3", "to": "Standard.LeftHandRing3"},
|
||||
{ "from": "Vive.LeftHandRing4", "to": "Standard.LeftHandRing4"},
|
||||
{ "from": "Vive.LeftHandPinky1", "to": "Standard.LeftHandPinky1"},
|
||||
{ "from": "Vive.LeftHandPinky2", "to": "Standard.LeftHandPinky2"},
|
||||
{ "from": "Vive.LeftHandPinky3", "to": "Standard.LeftHandPinky3"},
|
||||
{ "from": "Vive.LeftHandPinky4", "to": "Standard.LeftHandPinky4"},
|
||||
{ "from": "Vive.RightHand", "to": "Standard.RightHand" },
|
||||
{ "from": "Vive.RightHandThumb1", "to": "Standard.RightHandThumb1"},
|
||||
{ "from": "Vive.RightHandThumb2", "to": "Standard.RightHandThumb2"},
|
||||
{ "from": "Vive.RightHandThumb3", "to": "Standard.RightHandThumb3"},
|
||||
{ "from": "Vive.RightHandThumb4", "to": "Standard.RightHandThumb4"},
|
||||
{ "from": "Vive.RightHandIndex1", "to": "Standard.RightHandIndex1"},
|
||||
{ "from": "Vive.RightHandIndex2", "to": "Standard.RightHandIndex2"},
|
||||
{ "from": "Vive.RightHandIndex3", "to": "Standard.RightHandIndex3"},
|
||||
{ "from": "Vive.RightHandIndex4", "to": "Standard.RightHandIndex4"},
|
||||
{ "from": "Vive.RightHandMiddle1", "to": "Standard.RightHandMiddle1"},
|
||||
{ "from": "Vive.RightHandMiddle2", "to": "Standard.RightHandMiddle2"},
|
||||
{ "from": "Vive.RightHandMiddle3", "to": "Standard.RightHandMiddle3"},
|
||||
{ "from": "Vive.RightHandMiddle4", "to": "Standard.RightHandMiddle4"},
|
||||
{ "from": "Vive.RightHandRing1", "to": "Standard.RightHandRing1"},
|
||||
{ "from": "Vive.RightHandRing2", "to": "Standard.RightHandRing2"},
|
||||
{ "from": "Vive.RightHandRing3", "to": "Standard.RightHandRing3"},
|
||||
{ "from": "Vive.RightHandRing4", "to": "Standard.RightHandRing4"},
|
||||
{ "from": "Vive.RightHandPinky1", "to": "Standard.RightHandPinky1"},
|
||||
{ "from": "Vive.RightHandPinky2", "to": "Standard.RightHandPinky2"},
|
||||
{ "from": "Vive.RightHandPinky3", "to": "Standard.RightHandPinky3"},
|
||||
{ "from": "Vive.RightHandPinky4", "to": "Standard.RightHandPinky4"},
|
||||
{ "from": "Vive.Head", "to" : "Standard.Head" },
|
||||
{ "from": "Vive.LeftEye", "to" : "Standard.LeftEye" },
|
||||
{ "from": "Vive.RightEye", "to" : "Standard.RightEye" },
|
||||
{ "from": "Vive.LeftEyeBlink", "to" : "Standard.LeftEyeBlink" },
|
||||
{ "from": "Vive.RightEyeBlink", "to" : "Standard.RightEyeBlink" },
|
||||
|
||||
{
|
||||
"from": "Vive.LeftFoot", "to" : "Standard.LeftFoot",
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
#include <recording/Deck.h>
|
||||
#include <Rig.h>
|
||||
#include <trackers/FaceTracker.h>
|
||||
#include <trackers/EyeTracker.h>
|
||||
|
||||
#include "devices/DdeFaceTracker.h"
|
||||
#include "Application.h"
|
||||
|
@ -46,18 +45,32 @@ void MyHead::simulate(float deltaTime) {
|
|||
auto player = DependencyManager::get<recording::Deck>();
|
||||
// Only use face trackers when not playing back a recording.
|
||||
if (!player->isPlaying()) {
|
||||
auto faceTracker = qApp->getActiveFaceTracker();
|
||||
const bool hasActualFaceTrackerConnected = faceTracker && !faceTracker->isMuted();
|
||||
_isFaceTrackerConnected = hasActualFaceTrackerConnected || _owningAvatar->getHasScriptedBlendshapes();
|
||||
if (_isFaceTrackerConnected) {
|
||||
if (hasActualFaceTrackerConnected) {
|
||||
_blendshapeCoefficients = faceTracker->getBlendshapeCoefficients();
|
||||
}
|
||||
}
|
||||
// auto faceTracker = qApp->getActiveFaceTracker();
|
||||
// const bool hasActualFaceTrackerConnected = faceTracker && !faceTracker->isMuted();
|
||||
// _isFaceTrackerConnected = hasActualFaceTrackerConnected || _owningAvatar->getHasScriptedBlendshapes();
|
||||
// if (_isFaceTrackerConnected) {
|
||||
// if (hasActualFaceTrackerConnected) {
|
||||
// _blendshapeCoefficients = faceTracker->getBlendshapeCoefficients();
|
||||
// }
|
||||
// }
|
||||
|
||||
auto eyeTracker = DependencyManager::get<EyeTracker>();
|
||||
_isEyeTrackerConnected = eyeTracker->isTracking();
|
||||
// if eye tracker is connected we should get the data here.
|
||||
auto userInputMapper = DependencyManager::get<UserInputMapper>();
|
||||
bool eyeLidsTracked =
|
||||
userInputMapper->getActionStateValid(controller::Action::LEFT_EYE_BLINK) &&
|
||||
userInputMapper->getActionStateValid(controller::Action::RIGHT_EYE_BLINK);
|
||||
setFaceTrackerConnected(eyeLidsTracked);
|
||||
if (eyeLidsTracked) {
|
||||
float leftEyeBlink = userInputMapper->getActionState(controller::Action::LEFT_EYE_BLINK);
|
||||
float rightEyeBlink = userInputMapper->getActionState(controller::Action::RIGHT_EYE_BLINK);
|
||||
_blendshapeCoefficients.resize(std::max(_blendshapeCoefficients.size(), 2));
|
||||
_blendshapeCoefficients[0] = leftEyeBlink;
|
||||
_blendshapeCoefficients[1] = rightEyeBlink;
|
||||
} else {
|
||||
const float FULLY_OPEN = 0.0f;
|
||||
_blendshapeCoefficients.resize(std::max(_blendshapeCoefficients.size(), 2));
|
||||
_blendshapeCoefficients[0] = FULLY_OPEN;
|
||||
_blendshapeCoefficients[1] = FULLY_OPEN;
|
||||
}
|
||||
}
|
||||
Parent::simulate(deltaTime);
|
||||
}
|
||||
|
|
|
@ -347,6 +347,10 @@ namespace controller {
|
|||
makePosePair(Action::HIPS, "Hips"),
|
||||
makePosePair(Action::SPINE2, "Spine2"),
|
||||
makePosePair(Action::HEAD, "Head"),
|
||||
makePosePair(Action::LEFT_EYE, "LeftEye"),
|
||||
makePosePair(Action::RIGHT_EYE, "RightEye"),
|
||||
makeAxisPair(Action::LEFT_EYE_BLINK, "LeftEyeBlink"),
|
||||
makeAxisPair(Action::RIGHT_EYE_BLINK, "RightEyeBlink"),
|
||||
|
||||
makePosePair(Action::LEFT_HAND_THUMB1, "LeftHandThumb1"),
|
||||
makePosePair(Action::LEFT_HAND_THUMB2, "LeftHandThumb2"),
|
||||
|
|
|
@ -181,6 +181,11 @@ enum class Action {
|
|||
TRACKED_OBJECT_15,
|
||||
SPRINT,
|
||||
|
||||
LEFT_EYE,
|
||||
RIGHT_EYE,
|
||||
LEFT_EYE_BLINK,
|
||||
RIGHT_EYE_BLINK,
|
||||
|
||||
NUM_ACTIONS
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue