diff --git a/interface/resources/avatar/animations/sitting_idle.fbx b/interface/resources/avatar/animations/sitting_idle.fbx index ee03d942cd..63496f4673 100644 Binary files a/interface/resources/avatar/animations/sitting_idle.fbx and b/interface/resources/avatar/animations/sitting_idle.fbx differ diff --git a/interface/resources/avatar/animations/sitting_idle02.fbx b/interface/resources/avatar/animations/sitting_idle02.fbx deleted file mode 100644 index 8ac8764456..0000000000 Binary files a/interface/resources/avatar/animations/sitting_idle02.fbx and /dev/null differ diff --git a/interface/resources/avatar/animations/sitting_talk02.fbx b/interface/resources/avatar/animations/sitting_talk02.fbx new file mode 100644 index 0000000000..7e6a071c0e Binary files /dev/null and b/interface/resources/avatar/animations/sitting_talk02.fbx differ diff --git a/interface/resources/avatar/animations/sitting_talk03.fbx b/interface/resources/avatar/animations/sitting_talk03.fbx new file mode 100644 index 0000000000..73dff2e900 Binary files /dev/null and b/interface/resources/avatar/animations/sitting_talk03.fbx differ diff --git a/interface/resources/avatar/avatar-animation.json b/interface/resources/avatar/avatar-animation.json index 6c572f991b..4c41e608f9 100644 --- a/interface/resources/avatar/avatar-animation.json +++ b/interface/resources/avatar/avatar-animation.json @@ -590,29 +590,117 @@ "children": [ { "children": [ + { + "children": [ + ], + "data": { + "endFrame": 271, + "loopFlag": true, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/sitting_talk02.fbx" + }, + "id": "seatedTalk02", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 252, + "loopFlag": true, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/sitting_talk03.fbx" + }, + "id": "seatedTalk03", + "type": "clip" + } ], "data": { - "endFrame": 500, - "loopFlag": true, - "startFrame": 1, - "timeScale": 1, - "url": "qrc:///avatar/animations/talk.fbx" + "currentState": "seatedTalk02", + "randomSwitchTimeMax": 10, + "randomSwitchTimeMin": 1, + "states": [ + { + "id": "seatedTalk02", + "interpDuration": 6, + "interpTarget": 6, + "priority": 1, + "resume": true, + "transitions": [ + ] + }, + { + "id": "seatedTalk03", + "interpDuration": 6, + "interpTarget": 6, + "priority": 1, + "resume": true, + "transitions": [ + ] + } + ] }, "id": "seatedTalk", - "type": "clip" + "type": "randomSwitchStateMachine" }, { "children": [ + { + "children": [ + ], + "data": { + "endFrame": 800, + "loopFlag": true, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/sitting_idle.fbx" + }, + "id": "seatedIdle01", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 800, + "loopFlag": true, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/sitting_idle.fbx" + }, + "id": "seatedIdle02", + "type": "clip" + } ], "data": { - "endFrame": 800, - "loopFlag": true, - "startFrame": 1, - "timeScale": 1, - "url": "qrc:///avatar/animations/sitting_idle02.fbx" + "currentState": "seatedIdle01", + "randomSwitchTimeMax": 10, + "randomSwitchTimeMin": 1, + "states": [ + { + "id": "seatedIdle01", + "interpDuration": 6, + "interpTarget": 6, + "priority": 1, + "resume": true, + "transitions": [ + ] + }, + { + "id": "seatedIdle02", + "interpDuration": 6, + "interpTarget": 6, + "priority": 1, + "resume": true, + "transitions": [ + ] + } + ] }, "id": "seatedIdle", - "type": "clip" + "type": "randomSwitchStateMachine" } ], "data": { diff --git a/libraries/animation/src/Rig.cpp b/libraries/animation/src/Rig.cpp index b2070e06f7..f885f1113f 100644 --- a/libraries/animation/src/Rig.cpp +++ b/libraries/animation/src/Rig.cpp @@ -1942,8 +1942,13 @@ void Rig::updateReactions(const ControllerParameters& params) { reactionPlaying = idleStateMachine->getCurrentStateID().startsWith("reaction"); } + bool isSeated = _state == RigRole::Seated; bool hipsEnabled = params.primaryControllerFlags[PrimaryControllerType_Hips] & (uint8_t)ControllerFlags::Enabled; - if (reactionPlaying && !hipsEnabled) { + bool hipsEstimated = params.primaryControllerFlags[PrimaryControllerType_Hips] & (uint8_t)ControllerFlags::Estimated; + bool hmdMode = hipsEnabled && !hipsEstimated; + + if ((reactionPlaying || isSeated) && !hmdMode) { + // TODO: make this smooth. // disable head IK while reaction is playing, but only in "desktop" mode. _animVars.set("headType", (int)IKTarget::Type::Unknown); }