Hi everyone,

I am having difficulty setting a ray_cast_function from a python script for
Mayavi volume rendering. My usual approach is to record the "mayavi script"
from the pipeline gui and then emulate that code in my .py script. Naively
I thought the below would work:

#create some volume
> volume = mlab.pipeline.volume(src)
> volume.ray_cast_function_type = 'RayCastCompositeFunction'
> volume.volume_mapper_type = 'RayCastMapper'
> volume.ray_cast_function_type = 'RayCastMIPFunction'
>
> However, I get the following error:

/mayavi-4.5.1.dev0-py2.7-linux-x86_64.egg/mayavi/core/trait_defs.py",
line 97, in set_value
>     raise TraitError(object, name,"one of %s"%values, value)
> traits.trait_errors.TraitError: The 'ray_cast_function_type' trait of a 
> Volume instance must be one of [''], but a value of 
> 'RayCastCompositeFunction' <type 'str'> was specified.
>
> I am sure there must be a way to script this, but the source code doesn't
seem to reveal an obvious way. I attempted to naively swap around the order
of the ray_cast_function list in the source files, but while the gui gets
updated, the functionality does not.

Thanks for your time.

Vytas
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
MayaVi-users mailing list
MayaVi-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mayavi-users

Reply via email to