@sage-rsc/talking-head-react 1.4.2 → 1.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.js +3 -2
- package/package.json +1 -1
- package/src/lib/talkinghead.mjs +7 -5
package/dist/index.js
CHANGED
|
@@ -4240,8 +4240,9 @@ class Ne {
|
|
|
4240
4240
|
if ((!i && !s || i && s) && (this.poseTarget.props = this.mirrorPose(this.poseTarget.props), this.poseWeightOnLeft = !this.poseWeightOnLeft), this.gesture)
|
|
4241
4241
|
for (let [l, h] of Object.entries(this.gesture))
|
|
4242
4242
|
this.poseTarget.props.hasOwnProperty(l) && (this.poseTarget.props[l].copy(h), this.poseTarget.props[l].t = h.t, this.poseTarget.props[l].d = h.d);
|
|
4243
|
-
this.poseBase && this.poseBase.props && this.poseDelta && this.poseDelta.props && Object.keys(this.poseDelta.props).forEach((l) => {
|
|
4244
|
-
|
|
4243
|
+
this.poseBase && this.poseBase.props && this.poseDelta && this.poseDelta.props && this.poseTarget && this.poseTarget.props && Object.keys(this.poseDelta.props).forEach((l) => {
|
|
4244
|
+
const h = this.poseBase.props[l];
|
|
4245
|
+
!this.poseTarget.props.hasOwnProperty(l) && h && typeof h == "object" && typeof h.clone == "function" && (this.poseTarget.props[l] = h.clone(), this.poseTarget.props[l].t = this.animClock, this.poseTarget.props[l].d = o);
|
|
4245
4246
|
});
|
|
4246
4247
|
}
|
|
4247
4248
|
}
|
package/package.json
CHANGED
package/src/lib/talkinghead.mjs
CHANGED
|
@@ -2096,10 +2096,12 @@ class TalkingHead {
|
|
|
2096
2096
|
|
|
2097
2097
|
// Make sure deltas are included in the target
|
|
2098
2098
|
// Guard against disposal: check if poseBase and its props exist
|
|
2099
|
-
if (this.poseBase && this.poseBase.props && this.poseDelta && this.poseDelta.props) {
|
|
2099
|
+
if (this.poseBase && this.poseBase.props && this.poseDelta && this.poseDelta.props && this.poseTarget && this.poseTarget.props) {
|
|
2100
2100
|
Object.keys(this.poseDelta.props).forEach( key => {
|
|
2101
|
-
|
|
2102
|
-
|
|
2101
|
+
const baseProp = this.poseBase.props[key];
|
|
2102
|
+
// Ensure baseProp exists, is an object, and has a clone method
|
|
2103
|
+
if ( !this.poseTarget.props.hasOwnProperty(key) && baseProp && typeof baseProp === 'object' && typeof baseProp.clone === 'function' ) {
|
|
2104
|
+
this.poseTarget.props[key] = baseProp.clone();
|
|
2103
2105
|
this.poseTarget.props[key].t = this.animClock;
|
|
2104
2106
|
this.poseTarget.props[key].d = duration;
|
|
2105
2107
|
}
|
|
@@ -4374,8 +4376,8 @@ class TalkingHead {
|
|
|
4374
4376
|
*/
|
|
4375
4377
|
setAutoRotateSpeed(speed) {
|
|
4376
4378
|
if ( this.controls ) {
|
|
4377
|
-
|
|
4378
|
-
|
|
4379
|
+
this.controls.autoRotateSpeed = speed;
|
|
4380
|
+
this.controls.autoRotate = (speed > 0);
|
|
4379
4381
|
}
|
|
4380
4382
|
}
|
|
4381
4383
|
|