[vtkusers] Applying texture in pvpython environment

Jagjeet Nain jagjeet.nain at gmail.com
Wed Feb 23 15:18:05 EST 2011


Hi,
I have got a very simple problem.
I am trying to run below script in pvpython and trying to visualize an image
with it.
I have a image reader which returns me two arrays:
1) Normals
2) Texture Coordinates.
and with these arrays I am trying to visualize the image, but unable to do
so, since I am unable to apply the *Texture Map* returned by the reader.
The simple code which i am using is like this:

from paraview.simple import *
servermanager.LoadPlugin('GeoReferencedImageReaderReaderPlugin.so') # plugin
works fine in paraview GUI, image is loaded and displayed properly in
paraview GUI

reader=GeoTIFFReader(FileName='CCITT_2.TIF')
reader.UpdatePipelineInformation()
view = servermanager.CreateRenderView()
repr = servermanager.CreateRepresentation(reader, view)
di = reader.GetDataInformation()
pdinfo=di.GetPointDataInformation()
print pdinfo
*# Here I gets two array, array[0] = Normals, array[1]= Texture coordinates*
repr.ColorArrayName=pdinfo.GetArrayInformation(1).GetName() # I know this
step is wrong, I need an alternate step here to load texture, instead of
coloring it with the data, something like
*#repr.Texture=pdinfo.GetArrayInformation(0)  # But this doesn't work*
repr.MapScalars=False
repr.ColorAttributeType
view.ResetCamera()
view.StillRender()

Any Help in this will be very much appreciated.
Cheers
Jagjeet
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20110223/43986c3f/attachment.htm>


More information about the vtkusers mailing list