Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Glb-parser morph target fix #4474

Merged
merged 1 commit into from
Jul 25, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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