Skip to content

Movie support#411

Merged
prabhuramachandran merged 7 commits into
enthought:masterfrom
prabhuramachandran:movie_support
Jul 9, 2016
Merged

Movie support#411
prabhuramachandran merged 7 commits into
enthought:masterfrom
prabhuramachandran:movie_support

Conversation

@prabhuramachandran
Copy link
Copy Markdown
Member

@prabhuramachandran prabhuramachandran commented Jul 6, 2016

Adds support for recording movies and animating timesteps. Also added some documentation for this feature. For a timeseries, one can simply select the "play" checkbox and see an animation. For the timestep and mlab.animate one can very easily generate animations also.

This adds a `tvtk.pyface.movie_maker` which facilitates recording a
movie.  Also adds the ability to animate the timesteps for timeseries
data.  The timesteps for similar datasets can be synced.
If one has a scene with the movie_maker.record set to True, a movie will
be recorded when the animation is run.
Also cleanup the movie maker a bit so a user can set the directory and
expect things to work reasonably.  Fixed a few minor bugs in the process.
Also fix an issue when sync_timestep is chosen and update_files is
fired.
@codecov-io
Copy link
Copy Markdown

codecov-io commented Jul 6, 2016

Current coverage is 45.68%

Merging #411 into master will decrease coverage by 0.08%

@@             master       #411   diff @@
==========================================
  Files           254        255     +1   
  Lines         23030      23213   +183   
  Methods           0          0          
  Messages          0          0          
  Branches       3039       3067    +28   
==========================================
+ Hits          10543      10606    +63   
- Misses        11795      11886    +91   
- Partials        692        721    +29   

Powered by Codecov. Last updated by 68787e3...c8158fd

Comment thread mayavi/core/file_data_source.py Outdated
label='Delay'),
Item(name='loop'),
),
enabled_when='len(object.file_list) > 1'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

maybe visible_when is cleaner than enable_when so the UI group just does not show up when there is only one file?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yes, I agree, I will change this.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Ahh, I remember why I did this. I thought that if you start with a single file and then add a new one, it will not show the UI elements with visible_when. It appears that I am wrong. I just tested and this does work so I will use visible_when.

@kitchoi
Copy link
Copy Markdown
Contributor

kitchoi commented Jul 8, 2016

@prabhuramachandran The feature is cool! I have a few minor comments above and one question about the mlab.animate(support_movie=True):

I tested it locally and manually with an animation function that merely modify the camera. It does not seem to make a difference whether support_movie is True or not that both the movie feature and the animation feature can be supported at the same time. Or have I missed something? Can you explain a bit more on this please?

The rest looks good to me.

@prabhuramachandran
Copy link
Copy Markdown
Member Author

@kitchoi -- thanks for the review! The mlab.animate(support_movie=False) case will not invoke the animation start, step and stop methods. I only added this for the rare case when a user explicitly does not want to call those. This can happen if you want to run two animations simultaneously, for example (I have no idea if anyone would do it), let us say you have an animation that keeps rotating the camera about the "z" axis. Now let us say the user also has a timeseries and hits play. If support_movie were True, there would be a problem. In this case the user could use support_movie=False for the animation and the timeseries steps would be recorded as a movie. Is that clear?

@prabhuramachandran
Copy link
Copy Markdown
Member Author

@kitchoi -- can this be merged?

@kitchoi
Copy link
Copy Markdown
Contributor

kitchoi commented Jul 8, 2016

This can happen if you want to run two animations simultaneously, for example (I have no idea if anyone would do it), let us say you have an animation that keeps rotating the camera about the "z" axis. Now let us say the user also has a timeseries and hits play. If support_movie were True, there would be a problem.

I'm sorry I should have explained what I tested more clearly. In fact I tested exactly this scenario and I have not encountered a problem. The experience is the same for both support_movie=True and support_movie=False. I tried starting the animation while the movie-play is on and vice versa.
I tested using traitsui 5.1.0, pyface 5.1.0 + (pyside or wxpython)

@prabhuramachandran
Copy link
Copy Markdown
Member Author

Well, if two loops are being called you will end up with two calls to animation_start which will produce two different directories which should not happen when support_movie is False. The animation will still rotate the scene so the view should be the same but the animated function will not call animation_start/stop/step. I don't think the traits or pyface versions will matter. Am I missing something?

@kitchoi
Copy link
Copy Markdown
Contributor

kitchoi commented Jul 8, 2016

Thanks @prabhuramachandran Now I understood what the 'support_movie' does. I guess it is because of the context of the PR that I was confused. For others using 'animate', it should be clear what 'support_movie' does.

Please feel free to merge. Thanks.

@prabhuramachandran
Copy link
Copy Markdown
Member Author

@kitchoi -- thanks! Will merge this then.

@prabhuramachandran prabhuramachandran merged commit 6896aeb into enthought:master Jul 9, 2016
@prabhuramachandran prabhuramachandran deleted the movie_support branch July 9, 2016 04:52
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.

3 participants