-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Fix #125 by adding custom .interpolate method for ValueTracker #130
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
Conversation
Removed unused `.become_partial` method from Mobject Fixes #125
.interpolate method for ValueTracker|
This LGTM - but could you please leave an explanation here as to how this resolves #125? If only for the record :) |
Done :) |
|
Damnit approved by wrong account. |
|
that's better |
| """ | ||
| Turns self into an interpolation between mobject1 | ||
| and mobject2. | ||
| """ |
There was a problem hiding this comment.
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
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.