[Paraview] Representation
Utkarsh Ayachit
utkarsh.ayachit at kitware.com
Wed Jun 1 11:00:50 EDT 2011
You have to do something like:
obj = OpenDataFile("/home/luca/3dVoxView/Volumes_Storage/geostat_interp/Vol.vtk")
repr = Show()
repr.Representation = 'Volume'
....
But you also need to setup lookup table and scalar opacity function
for volume rendering. I'd recommend using the Python-Trace
functionality in ParaView. Load the data and change representation
type to volume and then look at the python trace generated. It will
show you to setup the lookup tables among other things.
Utkarsh
On Wed, Jun 1, 2011 at 10:39 AM, Luca Cinquepalmi
<cinquepalmi at planetek.it> wrote:
> Hi all,
> I'm trying to load a vtk file in Paraview using a simple python script. My
> script is:
>
> from paraview.simple import *
> obj =
> OpenDataFile("/home/luca/3dVoxView/Volumes_Storage/geostat_interp/Vol.vtk")
> obj.Representation = 'Volume'
> servermanager.SaveState("/home/luca/3dVoxView/Volumes_Storage/geostat_interp/prova.pvsm")
>
> but when I run my script this error appears:
>
> Traceback (most recent call last):
> File "paraviewProj.py", line 3, in <module>
> obj.Representation = 'Volume'
> File
> "/home/luca/3dVoxView/PARAVIEWWEB/build-paraview/Utilities/VTKPythonWrapping/site-packages/paraview/servermanager.py",
> line 207, in __setattr__
> "to add this attribute.")
> AttributeError: Attribute Representation does not exist. This class does
> not allow addition of new attributes to avoid mistakes due to typos. Use
> add_attribute() if you really want to add this attribute.
>
> what does it mean? what's wrong in obj.Representation='Volume' ? Thank you
> for any suggestion...
>
> Luca
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ParaView Wiki at:
> http://paraview.org/Wiki/ParaView
>
> Follow this link to subscribe/unsubscribe:
> http://www.paraview.org/mailman/listinfo/paraview
>
>
More information about the ParaView
mailing list