Skip to content

Commit 48f3d11

Browse files
committed
Resolves #35 by reducing mouth baseline values when speaking
1 parent 12c8f74 commit 48f3d11

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

modules/talkinghead.mjs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1680,13 +1680,15 @@ class TalkingHead {
16801680
const o = {};
16811681
for( let [mt,x] of Object.entries(this.animBaseline) ) {
16821682
const v = this.getValue(mt);
1683-
if ( v !== x.target ) {
1683+
const restrain = ( this.isSpeaking && mt.startsWith("mouth") ) ? 3 : 1;
1684+
const target = x.target / restrain;
1685+
if ( v !== target ) {
16841686
if ( x.t0 === undefined ) {
16851687
x.t0 = this.animClock;
16861688
x.v0 = v;
16871689
}
16881690
let delay = 1000;
1689-
o[mt] = this.valueAnimationSeq( [x.t0,x.t0+delay], [x.v0,x.target], this.animClock, this.easing );
1691+
o[mt] = this.valueAnimationSeq( [x.t0,x.t0+delay], [x.v0,target], this.animClock, this.easing );
16901692
} else {
16911693
x.t0 = undefined;
16921694
}

0 commit comments

Comments
 (0)