MayaVI Animate Dialog Box

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

MayaVI Animate Dialog Box

Dimagiba, Lorenzo
Hello all,

I am trying to create an animation using mayavi, but there are two things somewhat stumping me:

1) I'd like for the UI to not pop up, and as such in my code I put:
@mlab.animate(delay=150, ui = False)
This removes the UI, however it also prevents the animation from starting at all. Any ideas?

2) Instead of using the default animate UI, I'd like to create my own custom animate UI that's embedded with my scene. (in more basic terms, instead of having a separate UI,  I'd like the UI to be part of my window that displays the figure being animated). Is this possible?

Lorenzo

This e-mail may contain confidential and/or privileged information for the sole use of the intended recipient.
Any review or distribution by anyone other than the person for whom it was originally intended is strictly prohibited.
If you have received this e-mail in error, please contact the sender and delete all copies.
Opinions, conclusions or other information contained in this e-mail may not be that of the organization.

_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: MayaVI Animate Dialog Box

Gael Varoquaux
On Mon, Feb 25, 2013 at 03:56:19PM +0000, Dimagiba, Lorenzo wrote:
> I am trying to create an animation using mayavi, but there are two things somewhat stumping me:

> 1) I'd like for the UI to not pop up, and as such in my code I put:
> @mlab.animate(delay=150, ui = False)
> This removes the UI, however it also prevents the animation from starting at all. Any ideas?

Yes, you need to start the event loop. Try using 'mlab.show' as an
additional decorator:

@mlab.show
@mlab.animate
def ...

> 2) Instead of using the default animate UI, I'd like to create my own custom animate UI that's embedded with my scene. (in more basic terms, instead of having a separate UI,  I'd like the UI to be part of my window that displays the figure being animated). Is this possible?

Yes. 2 things.

 1. You need to learn about event loops. There is a bit of information
    scattered here and there about this in the Mayavi docs, but it's
    mainly a general GUI question that is controled via the toolkit.

 2. You need to learn about Traits UI and embeddeding views in traits ui.
    You'll also have to read a bit the source code of mlab.animate to
    understand what is going on.

G

_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev