Closed fnielsen closed 8 years ago
It may be worth to note that the same problem does not appear for the 'text' function, so this works ok:
from mayavi import mlab
mlab.points3d(0, 0, 0, opacity=0.5)
mlab.text(0, 0, 'A', z=0)
mlab.show()
I have now tried the problem on two Ubuntu 12.04 systems. On both systems the issue appears.
On my system, text3D isn't displaying anything, does someone has an idea what the problem is? or had a similar problem?
I have the same problem on my system (windows 8, pythonxy 2.7.10); text3d is not displaying anything. There are no error messages. Text3D objects do appear in the Mayavi pipeline window, yet the text isn't visible.
Reusing @fnielsen example:
In [1]: from mayavi import mlab
In [2]: mlab.points3d(0, 0, 0, opacity=0.5)
Out[2]: <mayavi.modules.glyph.Glyph at 0x12758d050>
In [3]: t = mlab.text3d(0, 0, 0, 'A')
In [4]: t.vector_text.update() // DO THIS
In [5]: mlab.show()
Update the vector_text. This is a bug and will be fixed in the next milestone. The real fix on a quick look is to add:
self.vector_text.update()
in _text_changed
after Line 124 here: https://github.com/enthought/mayavi/blob/master/mayavi/modules/text3d.py#L124
great! thanks
2015-07-21 3:15 GMT+02:00 eakraus notifications@github.com:
I have the same problem on my system (windows 8, pythonxy 2.7.10); text3d is not displaying anything. There are no error messages. Text3D objects do appear in the Mayavi pipeline window, yet the text isn't visible.
— Reply to this email directly or view it on GitHub https://github.com/enthought/mayavi/issues/169#issuecomment-123120754.
I ran this:
from mayavi import mlab
mlab.points3d(0, 0, 0, opacity=0.5)
t = mlab.text3d(0, 0, 0, 'A')
t.vector_text.update() # DO THIS
mlab.show()
and unfortunately I cannot confirm that it now works. There is still the problem for me. I do not have the same problem as @perconte. The text shows fine until fullscreen and then cannot be reestablished.
@fnielsen I see that you are using Ubuntu systems. This will need more investigation.
so I have an other problem sort of related, I'm unable to change the font size of the text visualization module. So mlab.text(0,0,0,'text',fontsize =12) and mlab.text(0,0,0,'text',fontsize =18) give the same result. Any idea? thanks in advance David
2015-07-21 10:22 GMT+02:00 Deepak Surti notifications@github.com:
@fnielsen https://github.com/fnielsen I see that you are using Ubuntu systems. This will need more investigation.
— Reply to this email directly or view it on GitHub https://github.com/enthought/mayavi/issues/169#issuecomment-123210772.
never mind, I just had to select Text scale mode none in TextActor
2015-07-21 17:52 GMT+02:00 David Perconte david.d.perconte@gmail.com:
so I have an other problem sort of related, I'm unable to change the font size of the text visualization module. So mlab.text(0,0,0,'text',fontsize =12) and mlab.text(0,0,0,'text',fontsize =18) give the same result. Any idea? thanks in advance David
2015-07-21 10:22 GMT+02:00 Deepak Surti notifications@github.com:
@fnielsen https://github.com/fnielsen I see that you are using Ubuntu systems. This will need more investigation.
— Reply to this email directly or view it on GitHub https://github.com/enthought/mayavi/issues/169#issuecomment-123210772.
The issue seems to have been solved with the present git version of Mayavi. I see the 'A' in fullscreen.
$ virtualenv --system-site-packages virtualenv_mayavigit
$ cd virtualenv_mayavigit/
$ source bin/activate
$ pip install -I git+git://github.com/enthought/mayavi.git
$ python
>>> from mayavi import mlab
(stack trace)
ValueError: cannot set toolkit to wx because it has already been set to qt4
>>> from mayavi import mlab
>>> mlab.points3d(0, 0, 0, opacity=0.5)
<mayavi.modules.glyph.Glyph object at 0x7f385ea5e0b0>
>>> mlab.text3d(0, 0, 0, 'A')
<mayavi.modules.text3d.Text3D object at 0x7f385ea1d5f0>
>>> mlab.show()
After these commands a ball and an 'A' are shown, - also in fullscreen.
(Interestingly, from mayavi import mlab
produces now an error the first time called! "ValueError: cannot set toolkit to wx because it has already been set to qt4").
Thanks @fnielsen!
Interestingly, from mayavi import mlab produces now an error the first time called! "ValueError: cannot set toolkit to wx because it has already been set to qt4".
That's likely because you have wxpython
installed and ipython has automatically switched to use wx
for gui support. However, since pyface
5.0.0, the default backend used by mayavi is qt4
, if the environment variable ETS_TOOLKIT
is unset (i.e. ETS_TOOLKIT=qt4
is the default). If you would like to use qt4
as the backend while using ipython, invoke ipython with ipython --gui=qt
. If you would like to use wx
as backend, try to set ETS_TOOLKIT=wx
. Please refer to http://docs.enthought.com/mayavi/mayavi/mlab.html and https://ipython.org/ipython-doc/2/interactive/reference.html#gui-event-loop-support
Note: I believe this issue can be closed when #332 is accepted and merged.
Yes, I have wxPython installed. ipython2 --gui=wx
works. ipython2 --gui=qt
did not and erred with "ValueError: API 'QDate' has already been set to version 1". With export ETS_TOOLKIT=qt4
then ipython2
works.
Oh yes you are right. ipython --gui=qt
set the QDate api to 1 while pyface
wanted to set the api to 2. This should be another issue for the doc. Thanks for trying these out and reporting!
Note: ipython --gui=qt
would work fine if PySide is used instead of PyQt.
Does it work with PyQt4 if you correctly set QT_API? See http://docs.enthought.com/mayavi/mayavi/building_applications.html#integrating-in-a-qt-application and http://ipython.readthedocs.org/en/stable/interactive/reference.html#pyqt-and-pyside
@jenshnielsen I have tried QT_API too and it works for me.
@jenshnielsen Ah I guess you mean setting QT_API=pyqt
and ipython
. There is no QDate api error but my interactive window is not happy. Let me take a look.
Yes that was what I meant. It used to work (years ago) but perhaps something broke along the way
For ValueError: cannot set toolkit to wx because it has already been set to qt4
problem, this is fixed in the master branch of enthought/traitsui
. If you do not want the bleeding edge, setting ETS_TOOLKIT=qt4
is the correct solution.
@jenshnielsen Sorry, I had a typo before when I set my environment (I actually had QT_API still at pyside when I tested pyqt). In summary, here is my finding.
QT_API=pyqt; ETS_TOOLKIT=qt4; ipython
work fine, interactive window is actually interactive.
QT_API=pyside; ETS_TOOLKIT=qt4
will require ipython --gui=qt
for the interactive window to be actually interactive
The ValueError: cannot set toolkit to wx because it has already been set to qt4
problem should be resolved with the new releases of traitsui
and pyface
.
The different usage of ipython
with QT_API=pyqt
and QT_API=pyside
remains, as described in http://ipython.readthedocs.org/en/stable/interactive/reference.html#pyqt-and-pyside
Closing.
On my system mayavi 4.4.0 (and the previous version) will make the text3d disappear when the window is made fullscreen.
Procedure:
After these commands a sphere and an A is displayed. Pressing the fullscreen button makes the text3d disappear from the scene. The Text3D object is still visible in the 'Mayavi pipline' window.