@pmndrs/viverse 0.2.15 → 0.2.16

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.
@@ -25,3 +25,4 @@ export declare function flattenCharacterAnimationOptions(options: Exclude<Charac
25
25
  export declare function loadCharacterAnimation(model: CharacterModel, url: string | DefaultUrl, type?: CharacterAnimationOptions['type'], removeXZMovement?: boolean, trimStartTime?: number | undefined, trimEndTime?: number | undefined, boneMap?: Record<string, VRMHumanBoneName> | undefined, scaleTime?: number | undefined, mask?: CharacterAnimationMask): Promise<AnimationClip>;
26
26
  export declare const mixamoBoneMap: Record<string, VRMHumanBoneName>;
27
27
  export declare const bvhBoneMap: Record<string, VRMHumanBoneName>;
28
+ export declare const allBoneNames: string[];
@@ -25,10 +25,13 @@ const nonVrmRotationOffset = new Quaternion().setFromEuler(new Euler(0, Math.PI,
25
25
  //TODO: currently assumes the model is not yet transformed - loaded for the first time
26
26
  export function fixModelAnimationClip(model, clip, clipScene, removeXZMovement) {
27
27
  clip.tracks = clip.tracks.filter((track) => {
28
+ const [clipBoneName, propertyName] = track.name.split('.');
29
+ if (!allBoneNames.includes(clipBoneName)) {
30
+ return false;
31
+ }
28
32
  if (track instanceof QuaternionKeyframeTrack) {
29
33
  return true;
30
34
  }
31
- const [clipBoneName, propertyName] = track.name.split('.');
32
35
  if (propertyName != 'position') {
33
36
  return false;
34
37
  }
@@ -279,3 +282,4 @@ export async function loadCharacterAnimation(model, url, type, removeXZMovement
279
282
  }
280
283
  export const mixamoBoneMap = _mixamoBoneMap;
281
284
  export const bvhBoneMap = _bvhBoneMap;
285
+ export const allBoneNames = Object.values(_mixamoBoneMap);
package/package.json CHANGED
@@ -21,7 +21,7 @@
21
21
  "peerDependencies": {
22
22
  "three": "*"
23
23
  },
24
- "version": "0.2.15",
24
+ "version": "0.2.16",
25
25
  "type": "module",
26
26
  "dependencies": {
27
27
  "@pixiv/three-vrm": "^3.4.2",