On Saturday 02 April 2011 12:01 AM, Giovanni Ghigliotti wrote:
Hi,
adding the two lines
   print mayavi
   print mayavi.engine
at the beginning of the script (run with mayavi2 -x script.py -o) gives:

<__main__.MayaviOffscreen object at 0xc0fd4dc>
ERROR|2011-04-01 11:30:24,454|'MayaviOffscreen' object has no attribute
'engine'
Traceback (most recent call last):
   File "/usr/bin/mayavi2", line 413, in run_script
     execfile(script_name, g, g)
   File "script.py", line 2, in<module>
     print mayavi.engine
AttributeError: 'MayaviOffscreen' object has no attribute 'engine'

Hmm, what version of Mayavi is this?  Can you try this:

mayavi2 -V

Also the script I attach works perfectly fine for me. Could you please check if it works for you?

cheers,
prabhu
from enthought.mayavi.sources.api import ParametricSurface
from enthought.mayavi.modules.api import Surface

print mayavi, mayavi.engine
s = engine.new_scene()
engine.add_source(ParametricSurface())
engine.add_module(Surface())

s.scene.save('s.png')

------------------------------------------------------------------------------
Create and publish websites with WebMatrix
Use the most popular FREE web apps or write code yourself; 
WebMatrix provides all the features you need to develop and 
publish your website. http://p.sf.net/sfu/ms-webmatrix-sf
_______________________________________________
MayaVi-users mailing list
MayaVi-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mayavi-users

Reply via email to