blank renderer

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

blank renderer

Eduardo Suarez-Santana
blank renderer

From these two examples, I get a blank no responding window in the second case. No errors shown at all. Well, not blank at all. There is kind of a small exclamation mark in the top left corner of the window.

Is there a way to debug what is going wrong?

Thanks in advance.

Gentoo GNU/Linux with wxGTK-2.8.10.1, wxpython-2.8.10.1, python-2.6.6, vtk-5.4.2, gtk+-2.22.1, and mayavi-3.4.1

$ python
>>> from enthought.tvtk.api import tvtk
>>> cs = tvtk.ConeSource(resolution=100)
>>> mapper = tvtk.PolyDataMapper(input=cs.output)
>>> actor = tvtk.Actor(mapper=mapper)
>>> renderer = tvtk.Renderer()
>>> render_window = tvtk.RenderWindow(size=(400,400))
>>> render_window.add_renderer(renderer)
>>> interactor = tvtk.RenderWindowInteractor(render_window=render_window)
>>> renderer.add_actor(actor)
>>> interactor.initialize()
>>> interactor.start()
>>>

$ python
Python 2.6.6 (r266:84292, Feb 28 2011, 09:15:58)
[GCC 4.4.4] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from enthought.tvtk.tools import ivtk
>>> from enthought.tvtk.api import tvtk
>>> cs = tvtk.ConeSource(resolution=100)
>>> mapper = tvtk.PolyDataMapper(input=cs.output)
>>> actor = tvtk.Actor(mapper=mapper)
>>> v = ivtk.IVTKWithCrustAndBrowser(size=(600,600))
>>> v.open()
>>> v.scene.add_actors(actor)
>>>


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

Re: blank renderer

Gael Varoquaux
On Tue, Mar 01, 2011 at 02:08:31PM +0000, Eduardo Suarez-Santana wrote:
>    From these two examples, I get a blank no responding window in the second
>    case. No errors shown at all. Well, not blank at all. There is kind of a
>    small exclamation mark in the top left corner of the window.

>    Is there a way to debug what is going wrong?

I think that you probably need to start the event loop. Either you run
this in "ipython -wthread", or you import GUI from enthought.pyface.api,
and you use GUI.start_event_loop.

Just a blind guess from reading my mail between meetings.

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

Re: blank renderer

Eduardo Suarez-Santana
El 01/03/11 15:50, Gael Varoquaux escribió:
> On Tue, Mar 01, 2011 at 02:08:31PM +0000, Eduardo Suarez-Santana wrote:
>>    Is there a way to debug what is going wrong?
> I think that you probably need to start the event loop. Either you run
> this in "ipython -wthread", or you import GUI from enthought.pyface.api,
> and you use GUI.start_event_loop.
I have tried 'ipython -wthread' with no success. I don't know how to use
GUI.start_event_loop. I tried:

>>> from enthought.pyface.api import GUI

>>> GUI.start_event_loop()
TypeError: unbound method start_event_loop() must be called with GUI
instance as first argument (got nothing instead)


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

Re: blank renderer

Gael Varoquaux
On Tue, Mar 01, 2011 at 05:21:02PM +0000, Eduardo Suarez-Santana wrote:
> El 01/03/11 15:50, Gael Varoquaux escribió:
> > On Tue, Mar 01, 2011 at 02:08:31PM +0000, Eduardo Suarez-Santana wrote:
> >>    Is there a way to debug what is going wrong?
> > I think that you probably need to start the event loop. Either you run
> > this in "ipython -wthread", or you import GUI from enthought.pyface.api,
> > and you use GUI.start_event_loop.
> I have tried 'ipython -wthread' with no success. I don't know how to use
> GUI.start_event_loop. I tried:

> >>> from enthought.pyface.api import GUI

> >>> GUI.start_event_loop()
> TypeError: unbound method start_event_loop() must be called with GUI
> instance as first argument (got nothing instead)

You need to instanciate the object::

    gui = GUI()
    gui.start_event_loop()

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

Re: blank renderer

Eduardo Suarez-Santana
El 01/03/11 17:41, Gael Varoquaux escribió:
> You need to instanciate the object::
>
>     gui = GUI()
>     gui.start_event_loop()

Thanks. It works now.

It works the same with 'python', 'ipython', and 'ipython -wthread'. As
far as I remember, 'GUI' was not necessary some time ago (I already had
some scripts), and the interpreter was not blocked by the windows.

Has something changed? Is there a way to avoid blocking the interpreter?

from enthought.tvtk.tools import ivtk
from enthought.pyface.api import GUI
from enthought.tvtk.api import tvtk
gui = GUI()
cs = tvtk.ConeSource(resolution=100)
mapper = tvtk.PolyDataMapper(input=cs.output)
actor = tvtk.Actor(mapper=mapper)
v = ivtk.IVTKWithCrustAndBrowser(size=(600,600))
v.open()
v.scene.add_actors(actor)
# no effect if next line is run before 'v.open()'
gui.start_event_loop()
# interpreter blocked

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

Re: blank renderer

Gael Varoquaux
On Wed, Mar 02, 2011 at 10:04:38AM +0000, Eduardo Suarez-Santana wrote:
> It works the same with 'python', 'ipython', and 'ipython -wthread'. As
> far as I remember, 'GUI' was not necessary some time ago (I already had
> some scripts), and the interpreter was not blocked by the windows.

Starting the event loop has always been necessary. I suspect that you
where running the scripts in 'ipython -wthread' (or 'ipython -pylab',
with the pylab ackend set to wx).

I am surprised that it doesn't work with 'ipython -wthread' as this is
exactly what it does: start the event loop for you.

> Has something changed?

If you are using a very recent version of IPython, it's event-loop
management code has changed, but it should still work.

> Is there a way to avoid blocking the interpreter?

Use IPython.

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

Re: blank renderer

Eduardo Suarez-Santana
El 02/03/11 10:12, Gael Varoquaux escribió:
>> Has something changed?
> If you are using a very recent version of IPython, it's event-loop
> management code has changed, but it should still work.
>
Using ipython-0.10.1
>> Is there a way to avoid blocking the interpreter?
> Use IPython.

Does not work so far. Will wait for next version.

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

Re: blank renderer

Gael Varoquaux
On Wed, Mar 02, 2011 at 11:07:28AM +0000, Eduardo Suarez-Santana wrote:
> El 02/03/11 10:12, Gael Varoquaux escribió:
> >> Has something changed?
> > If you are using a very recent version of IPython, it's event-loop
> > management code has changed, but it should still work.

> Using ipython-0.10.1
> >> Is there a way to avoid blocking the interpreter?
> > Use IPython.

> Does not work so far. Will wait for next version.

Works for me, with the same version of IPython.

Are you using the Qt or the Wx backend for Mayavi? If you are using the
Qt backend, you need to start IPython with the '-q4thread' option.

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

Re: blank renderer

Eduardo Suarez-Santana
El 02/03/11 11:12, Gael Varoquaux escribió:
>> Does not work so far. Will wait for next version.
> Works for me, with the same version of IPython.
>
> Are you using the Qt or the Wx backend for Mayavi? If you are using the
> Qt backend, you need to start IPython with the '-q4thread' option.
Is that in a config file or set in compilation time?

'q4thread' does the same.

It seems I'm using the wx backend:

$ mayavi2 &
$ pmap $! | grep wx | wc -l
73
$ mayavi2 &
$ pmap $! | grep qt | wc -l
0
$

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

Re: blank renderer

Eduardo Suarez-Santana
In reply to this post by Gael Varoquaux
El 02/03/11 10:12, Gael Varoquaux escribió:
> On Wed, Mar 02, 2011 at 10:04:38AM +0000, Eduardo Suarez-Santana wrote:
>> Is there a way to avoid blocking the interpreter?
> Use IPython.
It looks IPython is the problem:

$ ipython -wthread
Python 2.6.6 (r266:84292, Feb 28 2011, 09:15:58)
Type "copyright", "credits" or "license" for more information.

IPython 0.10.1 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object'. ?object also works, ?? prints more.

In [1]: import wx

In [2]: wx.App.IsMainLoopRunning()
Out[2]: False

In [3]:

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

Re: blank renderer

Chris Colbert
Works for me:

Chris-Colberts-MacBook-Pro:~ chris$ ipython -wthread
Enthought Python Distribution -- http://www.enthought.com

Python 2.7.1 |EPD 7.0-1 (32-bit)| (r271:86832, Dec  3 2010, 15:41:32) 
Type "copyright", "credits" or "license" for more information.

IPython 0.10.1 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object'. ?object also works, ?? prints more.

In [1]: import wx

In [2]: wx.App.IsMainLoopRunning()
Out[2]: True

On Thu, Mar 3, 2011 at 8:29 AM, Eduardo Suarez-Santana <[hidden email]> wrote:
El 02/03/11 10:12, Gael Varoquaux escribió:
> On Wed, Mar 02, 2011 at 10:04:38AM +0000, Eduardo Suarez-Santana wrote:
>> Is there a way to avoid blocking the interpreter?
> Use IPython.
It looks IPython is the problem:

$ ipython -wthread
Python 2.6.6 (r266:84292, Feb 28 2011, 09:15:58)
Type "copyright", "credits" or "license" for more information.

IPython 0.10.1 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object'. ?object also works, ?? prints more.

In [1]: import wx

In [2]: wx.App.IsMainLoopRunning()
Out[2]: False

In [3]:

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


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

Re: blank renderer

Eduardo Suarez-Santana
El 04/03/11 02:17, Chris Colbert escribió:

> Works for me:
>
> Chris-Colberts-MacBook-Pro:~ chris$ ipython -wthread
> Enthought Python Distribution -- http://www.enthought.com
>
> Python 2.7.1 |EPD 7.0-1 (32-bit)| (r271:86832, Dec  3 2010, 15:41:32)
> Type "copyright", "credits" or "license" for more information.
>
> IPython 0.10.1 -- An enhanced Interactive Python.
> ?         -> Introduction and overview of IPython's features.
> %quickref -> Quick reference.
> help      -> Python's own help system.
> object?   -> Details about 'object'. ?object also works, ?? prints more.
>
> In [1]: import wx
>
> In [2]: wx.App.IsMainLoopRunning()
> Out[2]: True

I have reported it to gentoo bugs.

https://bugs.gentoo.org/show_bug.cgi?id=357567

Thanks.

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