[Paraview] MantaView in pvpython

Roman Vetter vetterro at ethz.ch
Mon Mar 4 05:37:27 EST 2013


Hello everyone,

I'm trying to render a VTK mesh with Manta in pvpython. It runs fine in 
the GUI version of Paraview, but I can't get it to work in pvpython.

Essentially, as soon as I try to set a Manta-specific attribute of a 
DataRepresentation, python complains:


from paraview.simple import *
LoadPlugin("/path/to/my/libMantaView.so", False, globals())

paraview.simple._DisableFirstRenderCameraReset()
RenderView1 = GetRenderView()
Delete(RenderView1)
MantaView1 = CreateRenderView()

mesh00 = XMLUnstructuredGridReader( '/path/to/my/mesh.vtu' )
DataRepresentation1 = Show()
DataRepresentation1.MaterialType = 'phong'


 >> AttributeError: Attribute MaterialType does not exist. This class 
doesn not allow addition of new attributes to avoid mistakes due to typoes.


I'm assuming the view type is not set to Manta correctly, so the Manta 
attributes are not available. How to fix this? How to create a render 
view of a specific type, i.e.: Manta?

I've looked at the code produced in the python trace when doing it all 
manually in the GUI. The result is essentially the above; nothing that 
actually tells Paraview to use a Manta view type.


Thanks for your help!

Roman


More information about the ParaView mailing list