New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
can't interact with show and mouse #109
Comments
Thanks for the quick answer, |
Is is only related to volumes or it's the same with meshes? from vtkplotter import *
vol1 = load(datadir+'embryo.tif').scale(0.05)
sph = Sphere()
show(vol1, sph) Or, can you run this? |
the vtk runs and works well, trying to find embryo.tif now... |
ok I didn't install the examples, doing it now |
doesn' work with examples, same behaviour, the window closed as soon as I try to interact with it |
Sorry, I can't help u, I don't have any log or debug info, running on dell laptop, python 3.7 ,nvidia gtx1050 +intel gpu, vtk visualisation works and interact well, but show() renders but no interaction with mouse, keyboard ok for what I succeeded to test |
OK, thanks for reporting this, I'll give it a try on a windows system to see if i can reproduce the issue! |
Which VTK version are you using? |
...also, what happens if you add:
|
I can not reproduce the issue on Windows 10 with vtk 8.2.0 Some of the keys presses do cause the renderer to crash, but that is a known problem of vtk and has been solved on the master branch of vtk. |
settings.allowInteraction = False, doesn't change anything, I use vtk 8.1.0, I will try to update to vtk 8.2 |
I have vtk 8.1.2 actually |
Also, in Scripts I have vtkplotter not vtkplotter.exe when I modify the name and run it: |
Does this work for you? import vtk
from vtkplotter import load, datadir
vol = load(datadir+'embryo.tif')
ren = vtk.vtkRenderer()
ren.AddActor(vol)
renWin = vtk.vtkRenderWindow()
renWin.AddRenderer(ren)
iren = vtk.vtkRenderWindowInteractor()
iren.SetRenderWindow(renWin)
iren.Initialize()
iren.Start() |
This one works well, my bad for vtkplotter, vtkplotter is working well also. only problem with show.... |
OK. Next step: from vtkplotter import load, datadir, Plotter
vol = load(datadir+'embryo.tif')
vp = Plotter()
ren = vp.renderer
iren = vp.interactor
ren.AddActor(vol)
iren.Initialize()
iren.Start() |
this one crash |
show(datadir+'embryo.tif'), this also crash |
OK, but does it render an image? Any crashing message? Next: import vtk
from vtkplotter import load, datadir, Plotter, settings
settings.allowInteraction=False # try both
vol = load(datadir+'embryo.tif')
vp = Plotter()
ren = vp.renderer
iren = vp.interactor
renWin = vp.window
ren.AddActor(vol)
iren = vtk.vtkRenderWindowInteractor()
iren.SetRenderWindow(renWin)
iren.Initialize()
iren.Start() |
they all render images, no message, and this last one works (rendering, interact). when I say crash its for interaction |
True and False are working |
next: import vtk
from vtkplotter import load, datadir, Plotter, settings, Sphere
settings.allowInteraction=False
sph = Sphere().lw(0.1)
vp = Plotter()
ren = vp.renderer
ren.AddActor(sph)
iren = vtk.vtkRenderWindowInteractor()
iren.SetRenderWindow(vp.window)
iren.AddObserver("LeftButtonPressEvent", vp._mouseleft)
iren.AddObserver("RightButtonPressEvent", vp._mouseright)
iren.AddObserver("MiddleButtonPressEvent", vp._mousemiddle)
iren.AddObserver("KeyPressEvent", vp._keypress)
vsty = vtk.vtkInteractorStyleTrackballCamera()
iren.SetInteractorStyle(vsty)
iren.Initialize()
iren.Start() try interact, press |
works, h gives the help |
STOP!! import vtk settings.allowInteraction=False sph = Sphere().lw(0.1) this works.... |
..and the Volume can also be visualized and interacted with? |
Yes, but any datadir volume crash...: settings.allowInteraction=True sph = Sphere().lw(0.1)show(vol1) crash, sphere is working well |
True or False doesn't change anything |
Ok, this points to a gpu problem, the from vtkplotter import datadir, settings, Sphere, Volume, show
from vtkplotter.vtkio import loadImageData
settings.allowInteraction=True
img = loadImageData(datadir+'embryo.tif') # loads a vtkImageData obj
# mapper types are: gpu, opengl_gpu, smart, fixed, tetra, unstr
vol = Volume(img, mapperType='smart')
show(vol) |
crash, I am not sure which gpu card I am using with python, with vtk sure it uses the nvidia geforce, maybe show uses the intel for any reasons |
And huge thanks to you for your help, hope it can help others |
Fixed in less than 24h :) |
Indeed it should not crash with 'smart' mapper type... anyway, |
well, that was in my interest :) |
Hello,
Very nice job, I am struggling with interacting with 3d window (on windows, python)
I tried :
vp = Plotter(bg='black')
show both Volume and Mesh
vp.show(vol1,vol2,interactive=0)
vp.interactor.Render()
vp.interactor.Start()
and onmy show with interactive=True but everytime I click in the window it's closing....
I guess I missed something
Best,
Arnaud
The text was updated successfully, but these errors were encountered: