From: Jamie R. <jam...@gm...> - 2009-06-28 05:51:51
|
Sorry, here's the rest... for obj in scene.objects: obj.visible = false 2009/6/27 Jamie Riotto <jam...@gm...> > I believe setting scene.visible to false just makes the scene invisible, it > doesn't delete it, > unlike objects. If you'd like to reinitialize the scene then just delete > all visible objects: > > for obj in scene.objects: > > > > > On Sat, Jun 27, 2009 at 5:29 PM, Guy K. Kloss <g....@ma...>wrote: > >> Hi, >> >> as some may have noticed, I also run VPython with many things in batch >> mode. >> Unfortunately I've just hit a bump doing so. I introduced another layer >> for >> batching some computations/visualisations. So I'm wrapping my module and >> calling it repeatedly with changing parameters in a batch. Unfortunately >> when >> I'm doing that for me VPython "misbehaves". I cannot seem to find a way to >> discard a previous scene to create a new one. Whenever I just do it >> naively, I >> get this error: >> >> RuntimeError: Cannot change parameters of an active window >> >> As the new scene is being initialised with window title, size, ... >> >> I've already tried to retrieve the current scene with >> >> my_scene = visual.display.get_selected() >> >> And then set its visibility to False: >> >> my_scene.visible = False >> >> In this case the program just stalls and needs to be killed from another >> console. Or I try to delete the scene instance using: >> >> del my_scene >> >> or >> >> del visual.scene >> >> Which doesn't do anything as apparently visual.scene is a static module >> variable that cannot be discarded. >> >> Any ideas on how to make use of it in a sensible way without having to >> manually create new processes for each sample just to discard the scene? >> >> Guy >> >> -- >> Guy K. Kloss >> Institute of Information and Mathematical Sciences >> Te Kura Pūtaiao o Mōhiohio me Pāngarau >> Massey University, Albany (North Shore City, Auckland) >> 473 State Highway 17, Gate 1, Mailroom, Quad B Building >> voice: +64 9 414-0800 ext. 9585 fax: +64 9 441-8181 >> G....@ma... http://www.massey.ac.nz/~gkloss >> >> >> ------------------------------------------------------------------------------ >> _______________________________________________ >> Visualpython-users mailing list >> Vis...@li... >> https://lists.sourceforge.net/lists/listinfo/visualpython-users >> > > |