<div dir="ltr"><div>This error does not appear in Windows 8.1 or Mac OSX Mavericks.</div><div><br></div><div>Please refer to Mobius.zip.</div><div><br></div><div>In Ubuntu Linux 14.4 the following error is triggered when MobiusExample.py is executed or when Mobius.cxx is built and run.</div>
<div><br></div><div>vtkpython MobiusExample.py</div><div>X Error of failed request:  BadMatch (invalid parameter attributes)</div><div>  Major opcode of failed request:  155 (GLX)</div><div>  Minor opcode of failed request:  11 (X_GLXSwapBuffers)</div>
<div>  Serial number of failed request:  82</div><div>  Current serial number in output stream:  82</div><div><br></div><div>It is related to the fact that the vtkRenderWindowInteractor is declared after all the rendering work is done and placed in the render window.</div>
<div>If you do the usual:</div><div>    ren = vtk.vtkRenderer()</div><div>    renWin = vtk.vtkRenderWindow()</div><div>    iren = vtk.vtkRenderWindowInteractor()</div><div>    renWin.AddRenderer(ren)</div><div>    iren.SetRenderWindow(renWin)</div>
<div><br></div><div>and not return a renWin then everything works normally.</div><div>Look at MobiusExampleOK.py for this implementation.</div><div>In MobiusExampleOK.py, if you return a renWin then you need to click on the window to trigger the zoom and resize.</div>
<div><br></div><div>This reproducible in C++ (see Mobius.cxx) so the question really is:</div><div>"Why is vtkRenderWindowInteractor() positionally important in Linux?"</div><div><br></div><div>A quick check of the tests in VTK reveals that generally the "holy trinity" of:</div>
<div>    ren = vtk.vtkRenderer()</div><div>    renWin = vtk.vtkRenderWindow()</div><div>    iren = vtk.vtkRenderWindowInteractor()</div><div>    renWin.AddRenderer(ren)</div><div>    iren.SetRenderWindow(renWin)</div><div>
is implemented in both Python and C++ and TCL.</div><div>So this OpenGL error would never be triggered.</div><div><br></div><div>In the zipped up file there is also a C++ example that you can play with.</div><div>Move line 83-84 to 63 and line 86 to 65 will allow this to run without crashing in Linux.</div>
<div>However you will still need to click on the window to trigger the zoom.</div><div><br></div><div>In case anyone is wondering, the reason for writing the python code like this was to save an image when called from another python script but when run directly allow the user to interact with it. The other python script does not need the interactor, it is just running the code and saving the resultant image to a file.</div>
<div><br></div><div>I have tested it in Linux 14.4 running natively and as a virtual machine. Also I used a version of VTK (in the git repository) a few weeks old and then checked out the most recent version from the git repository after the changes to the DataModel and ExecutionModel. I am using NVidia drivers in both machines.</div>
<div>glxinfo | grep error</div><div>returns nothing.</div><div><br></div><div>Is vtkRenderWindowInteractor trying to reinitialize the GLX module after it has already been initialised by vtkRenderWindow? I'm guessing here. It still doesn't explain why the code works in Windows and Macs.</div>
<div><br></div><div>Regards</div><div>   Andrew</div><div><br></div>-- <br>___________________________________________<br>Andrew J. P. Maclean<br><br>___________________________________________
</div>