Skip to content

Commit

Permalink
Merge pull request #1374 from pixiv/fix-vrma-type
Browse files Browse the repository at this point in the history
fix: Fix type definition of VRM Animation
  • Loading branch information
0b5vr authored Feb 26, 2024
2 parents 0d96aea + 7cfbffd commit 6e5bcd5
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions packages/three-vrm-animation/src/VRMAnimationLoaderPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@ export class VRMAnimationLoaderPlugin implements GLTFLoaderPlugin {

const worldMatrixMap: VRMAnimationLoaderPluginWorldMatrixMap = new Map();

if (defExtension.humanoid == null) {
return worldMatrixMap;
}

for (const [boneName, humanBone] of Object.entries(defExtension.humanoid.humanBones)) {
const node = humanBone?.node;
if (node != null) {
Expand Down
2 changes: 1 addition & 1 deletion packages/types-vrmc-vrm-1.0/src/HumanoidHumanBones.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ import type { HumanoidHumanBoneName } from './HumanoidHumanBoneName';
* Represents a set of humanBones of a humanoid.
*/
export type HumanoidHumanBones = {
[key in HumanoidHumanBoneName]: HumanoidHumanBone;
[key in HumanoidHumanBoneName]?: HumanoidHumanBone;
};
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ import type { HumanoidHumanBoneName } from '@pixiv/types-vrmc-vrm-1.0';
* An object which maps humanoid bones to nodes.
*/
export type HumanoidHumanBones = {
[key in HumanoidHumanBoneName]: HumanoidHumanBone;
[key in HumanoidHumanBoneName]?: HumanoidHumanBone;
};
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export interface VRMCVRMAnimation {
/**
* An object which describes about humanoid bones.
*/
humanoid: Humanoid;
humanoid?: Humanoid;

/**
* An object which maps expressions to nodes.
Expand Down

0 comments on commit 6e5bcd5

Please sign in to comment.