Skip to content

Commit

Permalink
skip morph target curve outputs with no data (#4474)
Browse files Browse the repository at this point in the history
  • Loading branch information
ellthompson authored and slimbuck committed Aug 1, 2022
1 parent 5024274 commit 337e4af
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/resources/parser/glb-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -1415,6 +1415,10 @@ const createAnimation = function (gltfAnimation, animationIndex, gltfAccessors,
// All morph targets are included in a single channel of the animation, with all targets output data interleaved with each other.
// This function splits each morph target out into it a curve with its own output data, allowing us to animate each morph target independently by name.
const createMorphTargetCurves = (curve, node, entityPath) => {
if (!outputMap[curve.output]) {
Debug.warn(`glb-parser: No output data is available for the morph target curve (${entityPath}/graph/weights). Skipping.`);
return;
}
const morphTargetCount = outputMap[curve.output].data.length / inputMap[curve.input].data.length;
const keyframeCount = outputMap[curve.output].data.length / morphTargetCount;

Expand Down

0 comments on commit 337e4af

Please sign in to comment.