@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.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
- !this.poseTarget.props.hasOwnProperty(l) && this.poseBase.props[l] && (this.poseTarget.props[l] = this.poseBase.props[l].clone(), this.poseTarget.props[l].t = this.animClock, this.poseTarget.props[l].d = o);
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sage-rsc/talking-head-react",
3
- "version": "1.4.2",
3
+ "version": "1.4.3",
4
4
  "description": "A reusable React component for 3D talking avatars with lip-sync and text-to-speech",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",
@@ -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
- if ( !this.poseTarget.props.hasOwnProperty(key) && this.poseBase.props[key] ) {
2102
- this.poseTarget.props[key] = this.poseBase.props[key].clone();
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
- this.controls.autoRotateSpeed = speed;
4378
- this.controls.autoRotate = (speed > 0);
4379
+ this.controls.autoRotateSpeed = speed;
4380
+ this.controls.autoRotate = (speed > 0);
4379
4381
  }
4380
4382
  }
4381
4383