Dear experts,
I am running into a hard-to-debug problem with mayavi. I am running mayavi
in an interactive ipython session and I want to open more than one scene
with several different data sets in the same ipython session.
My code looks something like this:
----------------------------------------------------------
from mayavi import mlab as maya
import mayavi.tools as maya_tools
EM = maya_tools.engine_manager.EngineManager()
engine = EM.new_engine()
figure = maya.figure(engine)
# Plot some stuff in the figure:
tm = maya.triangular_mesh(x_plot, y_plot, z_plot, faces, scalars=scalars,
colormap=cmap, figure=figure)
poly_data_normals = engine.scenes[0].children[0].children[0]
module_manager = poly_data_normals.children[0]
module_manager.scalar_lut_manager.data_range = np.array([vmin, vmax])
----------------------------------------------------------
This works just fine the first time around and the second time around. But
on the third time, I get the following error:
54 scene.parallel_projection=True 55 ---> 56
poly_data_normals = engine.scenes[0].children[0].children[0] 57
poly_data_normals.filter.feature_angle = 80 # Extra smooth 58
module_manager = poly_data_normals.children[0]
IndexError: list index out of range
When examining in the debugger I see that indeed, this time around
engine.scenes is an empty list. What's going on and how do I fix it?
Thanks a bunch,
Ariel
------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
_______________________________________________
MayaVi-users mailing list
MayaVi-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mayavi-users