mlab.text fails
Hi,
I found that mlab.text becomes unusable after upgrade to 4.2. Is it a known problem? Thanks!
The report is also available at: https://github.com/enthought/mayavi/issues/35
from mayavi import mlab
mlab.text(0.1, 0.1, "test")
cause an error in MayaVi 4.2. (The code ran well before)
The error is pasted. Is it a bug?
/local_data/chenxing/capture/2012_06_05/ in ()
----> 1 mlab.text(0.1, 0.1, "asdfsf")
/usr/lib/python2.7/site-packages/mayavi/tools/pipe_base.py in the_function(*args, **kwargs)
35 def make_function(factory_class):
36 def the_function(*args, **kwargs):
---> 37 factory = factory_class(*args, **kwargs)
38 return factory._target
39
/usr/lib/python2.7/site-packages/mayavi/tools/decorations.py in init(self, x, y, text, **kwargs)
468 raise ValueError('Text positions should be in [0, 1] if no z'
469 'position is given')
--> 470 super(Text, self).init(None, **kwargs)
471 self._target.text = text
472 self._target.x_position = x
/usr/lib/python2.7/site-packages/mayavi/tools/pipebase.py in __init(self, parent, **kwargs)
142 self._do_redraw = not scene.disable_render
143 scene.disable_render = True
--> 144 if issubclass(self._target.class_, Filter):
145 self._engine.add_filter(self._target, obj=parent)
146 else:
/usr/lib/python2.7/site-packages/traits/trait_types.pyc in create_default_value(self, *args, **kw)
2776 raise TraitError, 'Unable to locate class: ' + args[0]
2777
-> 2778 return klass( *args[1:], **kw )
2779
2780 #: fixme: Do we still need this method using the new style?...
/usr/lib/python2.7/site-packages/mayavi/core/module.py in init(self, **traits)
56
57 # Let the module setup its pipeline.
---> 58 self.setuppipeline()
59
60 def __get_pure_state_(self):
/usr/lib/python2.7/site-packages/mayavi/modules/text.py in setup_pipeline(self)
156 actor.set(text_scale_mode='prop', width=0.4, height=1.0)
157 else:
--> 158 actor.set(scaled_text=True, width=0.4, height=1.0)
159
160 c = actor.position_coordinate
/usr/lib/python2.7/site-packages/traits/has_traits.pyc in trait_set(self, trait_change_notify, **traits)
1950 else:
1951 for name, value in traits.items():
-> 1952 setattr( self, name, value )
1953
1954 return self
TraitError: Cannot set the undefined 'scaled_text' attribute of a 'TextActor' object.
CHEN, Xing / 陈醒
_______________________________________________ Enthought-Dev mailing list Enthought-Dev@... https://mail.enthought.com/mailman/listinfo/enthought-dev
RSS Feed