>>>>> "Prabhu" == Prabhu Ramachandran <[EMAIL PROTECTED]> writes:
>>>>> "Peter" == Peter Schmitt <[EMAIL PROTECTED]> writes:
Peter> I want to load a custom gradient table color transfer
Peter> function (*.grad file) via a MayaVi2 script.
[...]
Prabhu> The trouble with discovering how to do this is that
Prabhu> mayavi2 itself saves something different and not the .grad
Prabhu> file. So I hadn't bothered adding the functionality to
Prabhu> load the grad file from a script. I'll check something in
Prabhu> to fix this shortly.
OK, I've checked in a fix to make this easier. Here is an example:
# ------ vol.py -----
mayavi.new_scene()
from enthought.mayavi.sources.vtk_file_reader import VTKFileReader
s = VTKFileReader()
s.initialize('/tmp/t.vtk')
mayavi.add_source(s)
from enthought.mayavi.modules import volume
v = volume.Volume()
volume.load_volume_prop_from_grad('/tmp/junk.grad',
v.volume_property,
(0.0, 1.0))
mayavi.add_module(v)
volume.save_volume_prop_to_grad(v.volume_property, '/tmp/test.grad')
# ------ vol.py -----
Again, run this as mayavi2 -x vol.py and it should work and is a lot
easier to use.
HTH.
cheers,
prabhu
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
MayaVi-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mayavi-users