I have a strange issue with reading OBJ file using VTK in Python. Code example below works fine for me.
reader = vtk.vtkOBJReader()
reader.SetFileName('cube.obj')
reader.Update()
inputP = reader.GetOutput()
app = QtGui.QApplication(sys.argv)
window = MainWindow(inputP)
sys.exit(app.exec_())
but if I first initialize QApplication, then vtkOBJReader throw an error message:
ERROR: In /build/vtk/src/VTK-6.1.0/IO/Geometry/vtkOBJReader.cxx, line 192 vtkOBJReader (0x56396fd14fa0): Error reading 'v' at line 5
Example code that does not work is shown below:
app = QtGui.QApplication(sys.argv)
reader = vtk.vtkOBJReader()
reader.SetFileName('cube.obj')
reader.Update()
inputP = reader.GetOutput()
window = MainWindow(inputP)
sys.exit(app.exec_())
I have the same issue if I wrote this program in C++. Have you any suggestions, how to force vtkOBJReader to work inside QT app?