Hi Anton,
Thanks for the suggestion.
--------
from paraview.simple import *
from vtk.vtkRenderingPython import * # <===== NEW LINE
#from vtk.libvtkRenderingPython import *
# Create a view
view = CreateRenderView()
# Initialize a new interactor
iren = vtkRenderWindowInteractor()
iren.SetInteractorStyle(vtkInteractorStyleTrackball())
iren.SetRenderWindow(view.GetRenderWindow())
iren.Initialize()
# Build pipeline
Sphere()
Show()
Render()
# Start interaction
iren.Start()
--------
Gives:
----
$ python test.py
Warning: In
/build/buildd/vtk-5.8.0/Rendering/vtkInteractorStyleTrackball.cxx, line 29
vtkInteractorStyleTrackball (0x3798210): vtkInteractorStyleTrackball
will be deprecated in
the next release after VTK 4.0. Please use
vtkInteractorStyleSwitch instead.
Traceback (most recent call last):
File "test.py", line 11, in <module>
iren.SetRenderWindow(view.GetRenderWindow())
TypeError: argument 1: method requires a VTK object
----
I don't have any clue about what to do - I suspect it has something to
do with the new ubuntu 12.04. Maybe I should fill in a bug report
somewhere to ubuntu maintainers (not expactly sure where, however)? Also
the pvpython thing, maybe should make me fill in a bug report for ubuntu
12.04 ?
------
$ pvpython test.py
Error converting executable file "/usr/bin/../lib/paraview/pvpython" to
real path: No such file or directory
------
Thanks, although it annoys me such a simple example is not working... I
cannot get starting learning vtk if I cannot run the simplest
examples... :-(
On 04/29/2012 01:41 PM, Anton Gladky wrote:
Hello,
try so:
from vtk.vtkRenderingPython import *
pvpython issue needs to be investigated.
Anton
2012/4/29 Newsboost Guy<[email protected]>:
Hi,
This, I think should work:
------------------
from paraview.simple import *
# Create a view
view = CreateRenderView()
# Initialize a new interactor
from vtk.libvtkRenderingPython import *
iren = vtkRenderWindowInteractor()
iren.SetInteractorStyle(vtkInteractorStyleTrackball())
iren.SetRenderWindow(view.GetRenderWindow())
iren.Initialize()
# Build pipeline
Sphere()
Show()
Render()
# Start interaction
iren.Start()
----------------
I'm using the latest ubuntu 12.04 so I suspect maybe this isnt too
good... Anyway, when I run the code I get:
-----
$ python test.py
Traceback (most recent call last):
File "test.py", line 7, in<module>
from vtk.libvtkRenderingPython import *
ImportError: No module named libvtkRenderingPython
-----
I then read that maybe I should better use "pvpython", this gives:
--
$ pvpython test.py
Error converting executable file "/usr/bin/../lib/paraview/pvpython" to
real path: No such file or directory
--
Sorry, I don't have much experience with this. It's a noob question, I
know. I hope somebody knows the answer/solution. Thank you very much -
I've been struggling with this (and making simple paraview python
scripts) for about 10 hours. No I have to ask you guys...
_______________________________________________
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
_______________________________________________
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