Hi,
This problem is well covered in scripting mode here
<http://code.enthought.com/projects/files/ETS32_API/enthought.mayavi.tools.modules.VolumeFactory.html>
In the case of a gui, Gael suggested somewhere using the record function. I
find it does not reflect changes in the ctf widget.
Here is my code. I find that I can access the ctf fine, and that the ctf I
access is sensitive to changes in the gui widget. I just can't find a way
to *set* the ctf.
class Vis(HasTraits):
scene = Instance(MlabSceneModel,())
save=Button()
load=Button()
editor=SceneEditor(scene_class=MayaviScene)
def __init__(self,G):
self.G=G
HasTraits.__init__(self)
self.array_src=ArraySource()
self.array_src.scalar_data=G
self.scene.mayavi_scene.add_child(self.array_src)
self.vol_module=Volume()
self.volume=self.array_src.add_module(self.vol_module)
def _save_fired(self):
self.my_crf=self.vol_module.volume_property.rgb_transfer_function
##Works!!
def _load_fired(self):
self.vol_module.volume_property.set_color(self.init_crf) ##Fails
and I need help
traits_view = View( ..)
vis=Vis(G)
vis.configure_traits()
Obvious workarounds like settings _ctf directly don't seem to work.
Thanks,
Chris
------------------------------------------------------------------------------
_______________________________________________
MayaVi-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mayavi-users