Renamed LipsTogether to MouthClose and bug fixes.

This commit is contained in:
Anthony J. Thibault 2019-10-21 19:37:57 -07:00
parent 92f1b59cc8
commit 03f88f696d
12 changed files with 19 additions and 10 deletions

View file

@ -208,7 +208,7 @@
{ "from": "Standard.Puff", "to": "Actions.Puff" }, { "from": "Standard.Puff", "to": "Actions.Puff" },
{ "from": "Standard.CheekSquint_L", "to": "Actions.CheekSquint_L" }, { "from": "Standard.CheekSquint_L", "to": "Actions.CheekSquint_L" },
{ "from": "Standard.CheekSquint_R", "to": "Actions.CheekSquint_R" }, { "from": "Standard.CheekSquint_R", "to": "Actions.CheekSquint_R" },
{ "from": "Standard.LipsTogether", "to": "Actions.LipsTogether" }, { "from": "Standard.MouthClose", "to": "Actions.MouthClose" },
{ "from": "Standard.MouthUpperUp_L", "to": "Actions.MouthUpperUp_L" }, { "from": "Standard.MouthUpperUp_L", "to": "Actions.MouthUpperUp_L" },
{ "from": "Standard.MouthUpperUp_R", "to": "Actions.MouthUpperUp_R" }, { "from": "Standard.MouthUpperUp_R", "to": "Actions.MouthUpperUp_R" },
{ "from": "Standard.MouthLowerDown_L", "to": "Actions.MouthLowerDown_L" }, { "from": "Standard.MouthLowerDown_L", "to": "Actions.MouthLowerDown_L" },

View file

@ -103,7 +103,7 @@
{ "from": "Standard.Puff", "to": "Actions.Puff" }, { "from": "Standard.Puff", "to": "Actions.Puff" },
{ "from": "Standard.CheekSquint_L", "to": "Actions.CheekSquint_L" }, { "from": "Standard.CheekSquint_L", "to": "Actions.CheekSquint_L" },
{ "from": "Standard.CheekSquint_R", "to": "Actions.CheekSquint_R" }, { "from": "Standard.CheekSquint_R", "to": "Actions.CheekSquint_R" },
{ "from": "Standard.LipsTogether", "to": "Actions.LipsTogether" }, { "from": "Standard.MouthClose", "to": "Actions.MouthClose" },
{ "from": "Standard.MouthUpperUp_L", "to": "Actions.MouthUpperUp_L" }, { "from": "Standard.MouthUpperUp_L", "to": "Actions.MouthUpperUp_L" },
{ "from": "Standard.MouthUpperUp_R", "to": "Actions.MouthUpperUp_R" }, { "from": "Standard.MouthUpperUp_R", "to": "Actions.MouthUpperUp_R" },
{ "from": "Standard.MouthLowerDown_L", "to": "Actions.MouthLowerDown_L" }, { "from": "Standard.MouthLowerDown_L", "to": "Actions.MouthLowerDown_L" },

View file

@ -64,7 +64,7 @@ static controller::Action blendshapeActions[] = {
controller::Action::PUFF, controller::Action::PUFF,
controller::Action::CHEEKSQUINT_L, controller::Action::CHEEKSQUINT_L,
controller::Action::CHEEKSQUINT_R, controller::Action::CHEEKSQUINT_R,
controller::Action::LIPSTOGETHER, controller::Action::MOUTHCLOSE,
controller::Action::MOUTHUPPERUP_L, controller::Action::MOUTHUPPERUP_L,
controller::Action::MOUTHUPPERUP_R, controller::Action::MOUTHUPPERUP_R,
controller::Action::MOUTHLOWERDOWN_L, controller::Action::MOUTHLOWERDOWN_L,

View file

@ -1217,6 +1217,10 @@ int AvatarData::parseDataFromBuffer(const QByteArray& buffer) {
_keyState = newKeyState; _keyState = newKeyState;
_handState = newHandState; _handState = newHandState;
if (!newHasScriptedBlendshapes && getHasScriptedBlendshapes()) {
// if scripted blendshapes have just been turned off, slam blendshapes back to zero.
_headData->clearBlendshapeCoefficients();
}
_headData->setHasScriptedBlendshapes(newHasScriptedBlendshapes); _headData->setHasScriptedBlendshapes(newHasScriptedBlendshapes);
_headData->setProceduralAnimationFlag(HeadData::SaccadeProceduralEyeJointAnimation, newHasProceduralEyeMovement); _headData->setProceduralAnimationFlag(HeadData::SaccadeProceduralEyeJointAnimation, newHasProceduralEyeMovement);
_headData->setProceduralAnimationFlag(HeadData::AudioProceduralBlendshapeAnimation, newHasAudioEnabledFaceMovement); _headData->setProceduralAnimationFlag(HeadData::AudioProceduralBlendshapeAnimation, newHasAudioEnabledFaceMovement);

View file

@ -83,6 +83,10 @@ int HeadData::getNumSummedBlendshapeCoefficients() const {
return maxSize; return maxSize;
} }
void HeadData::clearBlendshapeCoefficients() {
_blendshapeCoefficients.fill(0.0f, (int)_blendshapeCoefficients.size());
}
const QVector<float>& HeadData::getSummedBlendshapeCoefficients() { const QVector<float>& HeadData::getSummedBlendshapeCoefficients() {
int maxSize = std::max(_blendshapeCoefficients.size(), _transientBlendshapeCoefficients.size()); int maxSize = std::max(_blendshapeCoefficients.size(), _transientBlendshapeCoefficients.size());
if (_summedBlendshapeCoefficients.size() != maxSize) { if (_summedBlendshapeCoefficients.size() != maxSize) {

View file

@ -62,6 +62,7 @@ public:
const QVector<float>& getSummedBlendshapeCoefficients(); const QVector<float>& getSummedBlendshapeCoefficients();
int getNumSummedBlendshapeCoefficients() const; int getNumSummedBlendshapeCoefficients() const;
void setBlendshapeCoefficients(const QVector<float>& blendshapeCoefficients) { _blendshapeCoefficients = blendshapeCoefficients; } void setBlendshapeCoefficients(const QVector<float>& blendshapeCoefficients) { _blendshapeCoefficients = blendshapeCoefficients; }
void clearBlendshapeCoefficients();
const glm::vec3& getLookAtPosition() const { return _lookAtPosition; } const glm::vec3& getLookAtPosition() const { return _lookAtPosition; }
void setLookAtPosition(const glm::vec3& lookAtPosition) { void setLookAtPosition(const glm::vec3& lookAtPosition) {

View file

@ -393,7 +393,7 @@ namespace controller {
makeAxisPair(Action::PUFF, "Puff"), makeAxisPair(Action::PUFF, "Puff"),
makeAxisPair(Action::CHEEKSQUINT_L, "CheekSquint_L"), makeAxisPair(Action::CHEEKSQUINT_L, "CheekSquint_L"),
makeAxisPair(Action::CHEEKSQUINT_R, "CheekSquint_R"), makeAxisPair(Action::CHEEKSQUINT_R, "CheekSquint_R"),
makeAxisPair(Action::LIPSTOGETHER, "LipsTogether"), makeAxisPair(Action::MOUTHCLOSE, "MouthClose"),
makeAxisPair(Action::MOUTHUPPERUP_L, "MouthUpperUp_L"), makeAxisPair(Action::MOUTHUPPERUP_L, "MouthUpperUp_L"),
makeAxisPair(Action::MOUTHUPPERUP_R, "MouthUpperUp_R"), makeAxisPair(Action::MOUTHUPPERUP_R, "MouthUpperUp_R"),
makeAxisPair(Action::MOUTHLOWERDOWN_L, "MouthLowerDown_L"), makeAxisPair(Action::MOUTHLOWERDOWN_L, "MouthLowerDown_L"),

View file

@ -227,7 +227,7 @@ enum class Action {
PUFF, PUFF,
CHEEKSQUINT_L, CHEEKSQUINT_L,
CHEEKSQUINT_R, CHEEKSQUINT_R,
LIPSTOGETHER, MOUTHCLOSE,
MOUTHUPPERUP_L, MOUTHUPPERUP_L,
MOUTHUPPERUP_R, MOUTHUPPERUP_R,
MOUTHLOWERDOWN_L, MOUTHLOWERDOWN_L,

View file

@ -399,7 +399,7 @@ Input::NamedVector StandardController::getAvailableInputs() const {
makePair(PUFF, "Puff"), makePair(PUFF, "Puff"),
makePair(CHEEKSQUINT_L, "CheekSquint_L"), makePair(CHEEKSQUINT_L, "CheekSquint_L"),
makePair(CHEEKSQUINT_R, "CheekSquint_R"), makePair(CHEEKSQUINT_R, "CheekSquint_R"),
makePair(LIPSTOGETHER, "LipsTogether"), makePair(MOUTHCLOSE, "MouthClose"),
makePair(MOUTHUPPERUP_L, "MouthUpperUp_L"), makePair(MOUTHUPPERUP_L, "MouthUpperUp_L"),
makePair(MOUTHUPPERUP_R, "MouthUpperUp_R"), makePair(MOUTHUPPERUP_R, "MouthUpperUp_R"),
makePair(MOUTHLOWERDOWN_L, "MouthLowerDown_L"), makePair(MOUTHLOWERDOWN_L, "MouthLowerDown_L"),

View file

@ -134,7 +134,7 @@ namespace controller {
PUFF, PUFF,
CHEEKSQUINT_L, CHEEKSQUINT_L,
CHEEKSQUINT_R, CHEEKSQUINT_R,
LIPSTOGETHER, MOUTHCLOSE,
MOUTHUPPERUP_L, MOUTHUPPERUP_L,
MOUTHUPPERUP_R, MOUTHUPPERUP_R,
MOUTHLOWERDOWN_L, MOUTHLOWERDOWN_L,

View file

@ -54,7 +54,7 @@ const char* FACESHIFT_BLENDSHAPES[] = {
"Puff", "Puff",
"CheekSquint_L", "CheekSquint_L",
"CheekSquint_R", "CheekSquint_R",
"LipsTogether", "MouthClose",
"MouthUpperUp_L", "MouthUpperUp_L",
"MouthUpperUp_R", "MouthUpperUp_R",
"MouthLowerDown_L", "MouthLowerDown_L",

View file

@ -58,7 +58,7 @@ enum class Blendshapes : int {
Puff, Puff,
CheekSquint_L, CheekSquint_L,
CheekSquint_R, CheekSquint_R,
LipsTogether, MouthClose,
MouthUpperUp_L, MouthUpperUp_L,
MouthUpperUp_R, MouthUpperUp_R,
MouthLowerDown_L, MouthLowerDown_L,
@ -94,7 +94,7 @@ enum class LegacyBlendshpaes : int {
}; };
// NEW in ARKit // NEW in ARKit
// * LipsTogether // * MouthClose
// * MouthUpperUp_L // * MouthUpperUp_L
// * MouthUpperUp_R // * MouthUpperUp_R
// * MouthLowerDown_L // * MouthLowerDown_L