Skip to content

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

Conversation

m-agour
Copy link
Contributor

@m-agour m-agour commented Sep 26, 2022

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 become add_child_animation)
There is still modifing the tests. Tutorials will be updated in another PR.

Copy link
Contributor

@skoudoro skoudoro left a 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

Comment on lines 130 to 135
def _get_data(self, is_camera=False):
if is_camera:
self._is_camera_animated = True
return self._camera_data
else:
return self._data
Copy link
Contributor

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)

Comment on lines 8 to 9
import numpy as np
from scipy.spatial import transform
Copy link
Contributor

Choose a reason for hiding this comment

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

import order, check pep

colors = [1, 1, 1]
if len(lines) > 0:
lines = np.array([lines])
if colors is []:
Copy link
Contributor

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 isonly with None otherwise to check copy. see below

>>> a = []
>>> a is []
False

Comment on lines 153 to 154
def get_keyframes(self, attrib=None, is_camera=False):
"""Set a keyframe for a certain attribute.
Copy link
Contributor

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
Copy link
Contributor

Choose a reason for hiding this comment

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

typo: true

function that does not depend on keyframes.

Examples
---------
Copy link
Contributor

Choose a reason for hiding this comment

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

too long

Specifies whether the `interpolator` is time-only based evaluation
function that does not depend on keyframes.
Examples
---------
Copy link
Contributor

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

Comment on lines 524 to 525
Examples
---------
Copy link
Contributor

Choose a reason for hiding this comment

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

same as above

Comment on lines 541 to 542
Examples
---------
Copy link
Contributor

Choose a reason for hiding this comment

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

same as above

attrib = self._get_attribute_data(property_name)
attrib.get('callbacks', []).append(cbk_func)

def update_animation(self, t=None):
Copy link
Contributor

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

@skoudoro
Copy link
Contributor

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 add_child_timeline

@m-agour
Copy link
Contributor Author

m-agour commented Sep 27, 2022

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 add_child_timeline

@skoudoro Should I change the Timelines into Animations as well, in glTF animation?

@skoudoro
Copy link
Contributor

@skoudoro Should I change the Timelines into Animations as well, in glTF animation?

No @xtanion will have to do that, it will avoid conflict for him.

Thank you for the update

Copy link
Contributor

@filipinascimento filipinascimento left a 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)
Copy link
Contributor

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?

@m-agour m-agour changed the title Seperating Timeline into Timeline and Animation Seperating the Timeline into Timeline and Animation Nov 8, 2022
@codecov
Copy link

codecov bot commented Nov 8, 2022

Codecov Report

Merging #694 (207853e) into master (8e1cc27) will increase coverage by 0.02%.
The diff coverage is 0.00%.

❗ Current head 207853e differs from pull request most recent head 31758d9. Consider uploading reports for the commit 31758d9 to get more accurate results

Impacted file tree graph

@@            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     
Impacted Files Coverage Δ
fury/animation/__init__.py 0.00% <0.00%> (ø)
fury/animation/animation.py 0.00% <0.00%> (ø)
fury/animation/tests/test_animation.py 0.00% <0.00%> (ø)
fury/animation/tests/test_timeline.py 0.00% <0.00%> (ø)
fury/animation/timeline.py 0.00% <0.00%> (ø)
fury/gltf.py 0.00% <0.00%> (ø)
fury/fury/gltf.py 80.33% <0.00%> (ø)
fury/fury/animation/__init__.py 100.00% <0.00%> (ø)
fury/fury/animation/tests/test_animation.py 98.79% <0.00%> (ø)
fury/fury/animation/animation.py 69.15% <0.00%> (ø)
... and 5 more

@Garyfallidis
Copy link
Contributor

@m-agour please rebase.

@m-agour
Copy link
Contributor Author

m-agour commented Dec 2, 2022

Hi @Garyfallidis @skoudoro, The scipy problem has been fixed now.

@Garyfallidis
Copy link
Contributor

Thank you @m-agour.

@Garyfallidis Garyfallidis merged commit 8710a65 into fury-gl:master Dec 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants