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
Make text appear and disappear again #28
Comments
Hi @quakberto from vtkplotter import Text, screenshot, Plotter
vp = Plotter(axes=0, interactive=0)
for i in [0,1,2,3]:
text = Text('%03d' %i, c='white')
vp += text
# vp += more objects..
vp.show()
screenshot('htest_%03d.png' %i)
vp.remove(text) Let me know if it still does not work for you, |
that's funny... it must be something related to your python (?). In my ubuntu system with either python 2,3 your script gives the expected output. The color difference is caused by the fact the first time the rendering window does not yet exist, so vtkplotter makes it a default grey, This is fixed by explicitly setting |
Okay, that explains the grey. Still it's a bit strange that the second screenshot is also grey, as the rendering window already existed in the second iteration. Yeah, must be something in my environment which is clearly a bit strange. For example, despite it being a clean anaconda installation on a fresh MacOS, executing the same code above with ipython gives me a segfault (in the screenshot command). Without screenshot, the rendering window is not displayed. In any case I'll try to reproduce the problem on another system soon. Thanks for the help and I'll write here if I find out anything new in case anyone else stumbles upon a similar problem :) |
Hi again, I tried on my mac and YES, i can reproduce the issue! i´ll investigate that, thanks for spotting the issue, and get back to you asap. |
@quakberto git clone https://github.com/marcomusy/vtkplotter.git
cd vtkplotter
pip install . then: from vtkplotter import *
#this is needed when using ipython or from jupyter:
#embedWindow(False)
vp = Plotter(axes=0, interactive=0)
for i in [1,2,3]:
text = Text('%03d' %i, c='white')
vp += text
vp += Sphere(c=i).x(i)
vp.show()
screenshot('test_%03d.png' %i)
vp.remove(text) Let me know if the issue persists, |
Hi Marco, nice, after updating to your new version I get the same output as you! As your comment says, Thanks a lot for following up on the issue! Cheers, |
Hi, thanks for such a great tool!
I'm trying to have changing text in an animation and don't manage to properly make it appear and disappear. Consider this example:
Output: test_000.png shows 001 instead of 002...
Thanks a lot!
The text was updated successfully, but these errors were encountered: