[Paraview] volume render in pvpython
Patrick Shinpaugh
shpatric at vt.edu
Thu Sep 25 10:16:04 EDT 2008
Hi,
I am trying to use volume rendering through python interface. I have a
script which loads a pvd file which references a large group of vtk
unstructured grid files (.vtu). The script works fine except when I
change the representation to 4 (volume) at which point it segfaults. If
I load the data directly into paraview gui there is not an issue and if
running the script in the gui I manually change the representation to
volume after it has completed there is no problem. It appears to crash
as soon as the representation is changed in the script as no window is
opened.
The script is as follows:
**********************************************************************************
from paraview import servermanager
if not servermanager.ActiveConnection:
connection = servermanager.Connect()
reader =
servermanager.sources.PVDReader(FileName="/home/project/TurbDuctNetgen-Re1500/TurbDuctNetgen-Re1500.pvd")
pm = servermanager.ProxyManager()
source = pm.SMProxyManager.NewProxy("sources", "PVDReader")
pm.RegisterProxy("sources", "TurbDuctNetgen-Re1500.pvd", reader)
reader.UpdatePropertyInformation()
reader.TimestepValues
view = pm.GetProxy("views", "RenderView1")
if not view:
view = servermanager.CreateRenderView()
rep = servermanager.CreateRepresentation(reader, view)
pm.RegisterProxy("representations", "proxyrep1", rep)
# Check which representation is being used
rep.Representation
# Check to see which representations are available
rep.Representation.NewDomainIterator().GetKey()
domain = rep.Representation.GetDomain(
rep.Representation.NewDomainIterator().GetKey() )
for i in range( domain.GetNumberOfEntries() ):
print domain.GetEntryValue(i), domain.GetEntryText(i)
rep.ColorAttributeType = 0
rep.ColorArrayName = 'p'
rep.Representation = 4 # Volume --> CRASH
view.StillRender()
view.ResetCamera()
view.StillRender()
servermanager.AnimateReader(reader,view)
**********************************************************************************
The output of the script for both pvpython and pvbatch (spews some
additional error messages) when using volume:
pvpython pv.py
vtkPVDReader : [ ...........]
vtkPVDReader : [ ...........]
0 Points
1 Wireframe
2 Surface
3 Outline
4 Volume
5 Surface With Edges
vtkDataSetTriangleFilter : [ ...........]
vtkOpenGLProjectedTetrahedraMapper : [ ...........]
Segmentation fault
pvbatch pv.py
vtkPVDReader : [ ...........]
vtkPVDReader : [ ...........]
0 Points
1 Wireframe
2 Surface
3 Outline
4 Volume
5 Surface With Edges
vtkDataSetTriangleFilter : [ ...........]
vtkOpenGLProjectedTetrahedraMapper : [ ...........]
[pbslinux01:17619] *** Process received signal ***
[pbslinux01:17619] Signal: Segmentation fault (11)
[pbslinux01:17619] Signal code: Address not mapped (1)
[pbslinux01:17619] Failing at address: 0xadfd2a4
[pbslinux01:17619] [ 0] [0x11040c]
[pbslinux01:17619] [ 1]
/usr/local/ParaView-3.2.2/lib/paraview-3.2/libvtkVolumeRendering.so.pv3.2(_ZN34vtkOpenGLProjectedTetrahedraMapper17ProjectTetrahedraEP11vtkRendererP9vtkVolume+0x13e5)
[0x6d550b5]
[pbslinux01:17619] [ 2]
/usr/local/ParaView-3.2.2/lib/paraview-3.2/libvtkVolumeRendering.so.pv3.2(_ZN34vtkOpenGLProjectedTetrahedraMapper6RenderEP11vtkRendererP9vtkVolume+0xaa6)
[0x6d53b46]
[pbslinux01:17619] [ 3]
/usr/local/ParaView-3.2.2/lib/paraview-3.2/libvtkRendering.so.pv3.2(_ZN9vtkVolume24RenderVolumetricGeometryEP11vtkViewport+0x69)
[0x1eb2ca9]
[pbslinux01:17619] [ 4]
/usr/local/ParaView-3.2.2/lib/paraview-3.2/libvtkRendering.so.pv3.2(_ZN12vtkLODProp3D24RenderVolumetricGeometryEP11vtkViewport+0x50)
[0x1e161d0]
[pbslinux01:17619] [ 5]
/usr/local/ParaView-3.2.2/lib/paraview-3.2/libvtkPVFilters.so(_ZN14vtkPVLODVolume24RenderVolumetricGeometryEP11vtkViewport+0x27)
[0x9204247]
[pbslinux01:17619] [ 6]
/usr/local/ParaView-3.2.2/lib/paraview-3.2/libvtkRendering.so.pv3.2(_ZN11vtkRenderer14UpdateGeometryEv+0xf7)
[0x1e6bb67]
[pbslinux01:17619] [ 7]
/usr/local/ParaView-3.2.2/lib/paraview-3.2/libvtkRendering.so.pv3.2(_ZN17vtkOpenGLRenderer12DeviceRenderEv+0x67)
[0x1eea517]
[pbslinux01:17619] [ 8]
/usr/local/ParaView-3.2.2/lib/paraview-3.2/libvtkRendering.so.pv3.2(_ZN11vtkRenderer6RenderEv+0x145)
[0x1e6d935]
[pbslinux01:17619] [ 9]
/usr/local/ParaView-3.2.2/lib/paraview-3.2/libvtkRendering.so.pv3.2(_ZN21vtkRendererCollection6RenderEv+0x20b)
[0x1e75e7b]
[pbslinux01:17619] [10]
/usr/local/ParaView-3.2.2/lib/paraview-3.2/libvtkRendering.so.pv3.2(_ZN15vtkRenderWindow14DoStereoRenderEv+0xa3)
[0x1e5f383]
[pbslinux01:17619] [11]
/usr/local/ParaView-3.2.2/lib/paraview-3.2/libvtkRendering.so.pv3.2(_ZN15vtkRenderWindow10DoFDRenderEv+0x339)
[0x1e5f1c9]
[pbslinux01:17619] [12]
/usr/local/ParaView-3.2.2/lib/paraview-3.2/libvtkRendering.so.pv3.2(_ZN15vtkRenderWindow10DoAARenderEv+0x450)
[0x1e601a0]
[pbslinux01:17619] [13]
/usr/local/ParaView-3.2.2/lib/paraview-3.2/libvtkRendering.so.pv3.2(_ZN15vtkRenderWindow6RenderEv+0x133)
[0x1e5e483]
[pbslinux01:17619] [14]
/usr/local/ParaView-3.2.2/lib/paraview-3.2/libvtkRendering.so.pv3.2(_ZN22vtkXOpenGLRenderWindow6RenderEv+0x54)
[0x1f07874]
[pbslinux01:17619] [15]
/usr/local/ParaView-3.2.2/lib/paraview-3.2/libvtkPVServerManager.so(_ZN20vtkSMRenderViewProxy13PerformRenderEv+0x3a)
[0x1609f5a]
[pbslinux01:17619] [16]
/usr/local/ParaView-3.2.2/lib/paraview-3.2/libvtkPVServerManager.so(_ZN14vtkSMViewProxy11StillRenderEv+0x58)
[0x1648c48]
[pbslinux01:17619] [17]
/usr/local/ParaView-3.2.2/lib/paraview-3.2/libvtkPVServerManagerPythonD.so
[0x1a39f3]
[pbslinux01:17619] [18]
/usr/lib/libpython2.5.so.1.0(PyCFunction_Call+0x14d) [0x48867ed]
[pbslinux01:17619] [19] /usr/lib/libpython2.5.so.1.0(PyObject_Call+0x37)
[0x4854157]
[pbslinux01:17619] [20]
/usr/lib/libpython2.5.so.1.0(PyEval_EvalFrameEx+0x42f7) [0x48d1787]
[pbslinux01:17619] [21]
/usr/lib/libpython2.5.so.1.0(PyEval_EvalCodeEx+0x7ef) [0x48d46bf]
[pbslinux01:17619] [22]
/usr/lib/libpython2.5.so.1.0(PyEval_EvalFrameEx+0x53b4) [0x48d2844]
[pbslinux01:17619] [23]
/usr/lib/libpython2.5.so.1.0(PyEval_EvalCodeEx+0x7ef) [0x48d46bf]
[pbslinux01:17619] [24]
/usr/lib/libpython2.5.so.1.0(PyEval_EvalCode+0x63) [0x48d4743]
[pbslinux01:17619] [25] /usr/lib/libpython2.5.so.1.0 [0x48ee3e6]
[pbslinux01:17619] [26]
/usr/lib/libpython2.5.so.1.0(PyRun_FileExFlags+0x8e) [0x48ee49e]
[pbslinux01:17619] [27]
/usr/lib/libpython2.5.so.1.0(PyRun_SimpleFileExFlags+0x198) [0x48efb58]
[pbslinux01:17619] [28]
/usr/lib/libpython2.5.so.1.0(PyRun_AnyFileExFlags+0x7a) [0x48f02ba]
[pbslinux01:17619] [29] /usr/lib/libpython2.5.so.1.0(Py_Main+0xaa6)
[0x48f9e06]
[pbslinux01:17619] *** End of error message ***
Segmentation fault
Has anyone else run into this? Is there something special I need to do
for volume rendering? Any ideas?
Thanks,
Pat
--
Patrick Shinpaugh
Virginia Tech
UVAG System Administrator/Programmer
540-231-2054
More information about the ParaView
mailing list