Skip to content

Conversation

@Aathish04
Copy link
Member

@Aathish04 Aathish04 commented Jun 3, 2020

Added custom .interpolate method for ValueTracker

Removed unused .become_partial method from Mobject

Removed Trailing Spaces from ValueTracker and Mobject.

Fixes #125

Commit 62050bb had changed the pass statements of some of the methods of Mobject() into NotImplementedError s.
The method interpolate_color was one such method.

ThreeDCamera uses ValueTracker Mobjects in order to store the positions of the camera.

When ThreeDScene.move_camera() is called, the interpolate mobject of the ValueTracker is called.
This method then calls interpolate_color, and since ValueTracker does not have a custom interpolate_color method, it uses the one in Mobject which it inherits from.

The interpolate_color method of Mobject only raises a NotImplementedError, and this results in ThreeDScene.move_camera() failing.

This PR adds a custom interpolate method for ValueTracker, as suggested by @tony031218. This custom method does not call interpolate_color and hence fixes the issue.

Also, the .become_partial method was not mentioned anywhere outside of its definition, which itself simply raised a NotImplementedError, and hence was removed.

Removed unused `.become_partial` method from Mobject

Fixes #125
@Aathish04 Aathish04 requested a review from leotrs June 3, 2020 11:50
@Aathish04 Aathish04 changed the title Fix #125 by adding custom .interpolate method for ValueTracker Fix #125 by adding custom .interpolate method for ValueTracker Jun 3, 2020
@leotrs
Copy link
Contributor

leotrs commented Jun 3, 2020

This LGTM - but could you please leave an explanation here as to how this resolves #125? If only for the record :)

@Aathish04
Copy link
Member Author

This LGTM - but could you please leave an explanation here as to how this resolves #125? If only for the record :)

Done :)
Ive added it to the main comment of this PR

@kilacoda
Copy link
Contributor

kilacoda commented Jun 3, 2020

Damnit approved by wrong account.

@kilacoda-old
Copy link
Contributor

that's better

@PgBiel PgBiel added the pr:bugfix Bug fix for use in PRs solving a specific issue:bug label Jun 3, 2020
Comment on lines +32 to +35
"""
Turns self into an interpolation between mobject1
and mobject2.
"""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was going to comment about documentation guidelines, but I guess we can just copy the interpolate docs from when we finish them from Mobject into this, so should be ok

@PgBiel PgBiel merged commit 4614496 into master Jun 3, 2020
@PgBiel PgBiel deleted the fix-125 branch June 3, 2020 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:bugfix Bug fix for use in PRs solving a specific issue:bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ThreeDScene.move_camera() results in NotImplementedError

7 participants