-
Notifications
You must be signed in to change notification settings - Fork 186
Seperating the Timeline into Timeline and Animation #694
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
Seperating the Timeline into Timeline and Animation #694
Conversation
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.
See below a quick review, I will look deeper tomorrow
fury/animation/animation.py
Outdated
def _get_data(self, is_camera=False): | ||
if is_camera: | ||
self._is_camera_animated = True | ||
return self._camera_data | ||
else: | ||
return self._data |
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.
you split it for all the other functions so you should split here also (_get_data
and get_camera_data
)
fury/animation/animation.py
Outdated
import numpy as np | ||
from scipy.spatial import transform |
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.
import order, check pep
fury/animation/animation.py
Outdated
colors = [1, 1, 1] | ||
if len(lines) > 0: | ||
lines = np.array([lines]) | ||
if colors is []: |
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.
avoid is
, it will return what you expect. use is
only with None
otherwise to check copy. see below
>>> a = []
>>> a is []
False
fury/animation/animation.py
Outdated
def get_keyframes(self, attrib=None, is_camera=False): | ||
"""Set a keyframe for a certain attribute. |
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.
Get or Set ?
is_camera: bool, optional | ||
Indicated whether setting a camera property or general property. | ||
update_interpolator: bool, optional | ||
Interpolator will be reinitialized if Ture |
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.
typo: true
fury/animation/animation.py
Outdated
function that does not depend on keyframes. | ||
|
||
Examples | ||
--------- |
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.
too long
fury/animation/animation.py
Outdated
Specifies whether the `interpolator` is time-only based evaluation | ||
function that does not depend on keyframes. | ||
Examples | ||
--------- |
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.
too long and miss empty line between 2 sections
fury/animation/animation.py
Outdated
Examples | ||
--------- |
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.
same as above
fury/animation/animation.py
Outdated
Examples | ||
--------- |
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.
same as above
fury/animation/animation.py
Outdated
attrib = self._get_attribute_data(property_name) | ||
attrib.get('callbacks', []).append(cbk_func) | ||
|
||
def update_animation(self, t=None): |
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.
avoid 1 letter variable. 3 letters minimum. to update
All tests are failing, can you fix the issue in this PR? see here: https://github.com/fury-gl/fury/actions/runs/3135809301/jobs/5091933852#step:12:433 this is due to the renaming of |
…ine`-into-`Timeline`-and-`Animation`
@skoudoro Should I change the |
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.
Thanks, this one looks good. Please check other places that you still may be calling timeline.add_child_animation
.
|
||
############################################################################### | ||
# Adding the main animation to the Timeline. | ||
timeline.add_child_animation(main_arm_animation) |
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.
This should be timeline.add_animation
, correct?
No matter if it was set automatically of by a Timeline
…ine`-into-`Timeline`-and-`Animation`
Timeline
into Timeline
and Animation
Codecov Report
@@ Coverage Diff @@
## master #694 +/- ##
==========================================
+ Coverage 50.19% 50.21% +0.02%
==========================================
Files 120 126 +6
Lines 28019 28291 +272
Branches 2987 3033 +46
==========================================
+ Hits 14063 14206 +143
- Misses 13489 13611 +122
- Partials 467 474 +7
|
@m-agour please rebase. |
…ine`-into-`Timeline`-and-`Animation`
Hi @Garyfallidis @skoudoro, The scipy problem has been fixed now. |
Thank you @m-agour. |
In this PR, a new structure for the animation module is introduced while maintaining the old API (except for
add_child_timeline
is changed to becomeadd_child_animation
)There is still modifing the tests. Tutorials will be updated in another PR.