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

Fix transform matrix precalculation when adding effects #2990

Merged
merged 1 commit into from
Jun 11, 2023

Conversation

geomaster
Copy link
Contributor

The transform matrix might be precalculated again when effects are added to various properties of the transform. However, the matrix was not being reset to identity, and the appliedTransformations member was not being reset to 0, which caused components of the transform to be applied multiple times.

(To reproduce: create an animation, and at a later time, apply an effect to the rotation using transform.r.addEffect(). Observe how the object gets a rotation that is the sum of the initial value and the one returned from the effect, when it should just be the value returned to the effect.)

Additionally, for the anchor point property, its eligibility for precalculation was checked only by considering whether it's keyframed, when it also could have had an effects sequence added.

(To reproduce: create an animation, and at a later time, apply an effect to the anchor point via transform.a.addEffect(). Observe how the effect does nothing, as the anchor point would still end up precalculated.)

Reset the precalculated matrix and appliedTransformations in
precalculateMatrix().

Check for the existence of an effect on the anchor point property
instead of checking if it's keyframed.

--

The transform matrix might be precalculated again when effects are added
to various properties of the transform. However, the matrix was not
being reset to identity, and the appliedTransformations member was not
being reset to 0, which caused components of the transform to be applied
multiple times.

(To reproduce: create an animation, and at a later time, apply an effect
to the rotation using transform.r.addEffect(). Observe how the object
gets a rotation that is the sum of the initial value and the one
returned from the effect, when it should just be the value returned to
the effect.)

Additionally, for the anchor point property, its eligibility for
precalculation was checked only by considering whether it's keyframed,
when it also could have had an effects sequence added.

(To reproduce: create an animation, and at a later time, apply an effect
to the anchor point via transform.a.addEffect(). Observe how the effect
does nothing, as the anchor point would still end up precalculated.)
@geomaster geomaster changed the title Fix transform matrix precalc when adding effects Fix transform matrix precalculation when adding effects Jun 9, 2023
@bodymovin bodymovin merged commit 8deda2d into airbnb:master Jun 11, 2023
1 check failed
@bodymovin
Copy link
Collaborator

thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants