8000 Fix blendShapeAnimation crossFade bug by luzhuang · Pull Request #1840 · galacean/engine · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix blendShapeAnimation crossFade bug #1840

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

Merged
merged 8 commits into from
Oct 27, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export class AnimationCurveOwner<V extends KeyframeValueType> {
this.component = target.getComponent(type);
this.cureType = cureType;
const isBlendShape = this.component instanceof SkinnedMeshRenderer;
// @todo: Temp solution with blendShape
// @todo: Temp solution with blendShape bug when multi SkinnedMeshRenderer in a entity. we need to run setTargetValue to solve it.
this._isCopyMode = cureType._isCopyMode && !isBlendShape;

const assemblerType = AnimationCurveOwner.getAssemblerType(type, property);
Expand Down Expand Up @@ -185,7 +185,8 @@ export class AnimationCurveOwner<V extends KeyframeValueType> {
cureType._lerpValue(targetValue, value, weight, targetValue);
} else {
const originValue = this._assembler.getTargetValue();
const lerpValue = cureType._lerpValue(originValue, value, weight);
// @todo: Temp solution in PR: https://github.com/galacean/engine/pull/1840
const lerpValue = cureType._lerpValue(originValue, value, weight, originValue);
this._assembler.setTargetValue(lerpValue);
}
}
Expand All @@ -196,7 +197,13 @@ export class AnimationCurveOwner<V extends KeyframeValueType> {
if (this._isCopyMode) {
return this.cureType._lerpValue(srcValue, destValue, crossWeight, this.baseEvaluateData.value);
} else {
this.baseEvaluateData.value = this.cureType._lerpValue(srcValue, destValue, crossWeight);
// @todo: Temp solution in PR: https://github.com/galacean/engine/pull/1840
this.baseEvaluateData.value = this.cureType._lerpValue(
srcValue,
destValue,
crossWeight,
this.baseEvaluateData.value
);
return this.baseEvaluateData.value;
}
}
Expand Down
0