From: Jamie R. <jam...@gm...> - 2009-06-28 20:22:31
|
On Sat, Jun 27, 2009 at 11:38 PM, Guy K. Kloss <g....@ma...> wrote: > > On Sun, 28 Jun 2009 17:51:47 Jamie Riotto wrote: > > 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: > > obj.visible = false > > That ought to be "False". But that also doesn't work, as visual.scene is the > object that complains about re-initialised, and that one is a module level > variable, so it can only be initialised once per running Python process. > > Iterating over the objects and setting their visibility to False should (A) > just hide them, but not delete them, and (B) still leave the current scene's > instance in the state it's in. So that's not helpful, either. Guy, I understand my suggestion didn't fix your problem, but as to your point (A), that setting visiblity to False should hide objects and not delete them, from the VPython Docs: Deleting an Object To delete a Visual object just make it invisible: ball.visible = 0 (Not that I agree with the behavior, I'd prefer being able to make things visible and invisible at will without having to manage the invisible objects (i.e. deleted) myself) Cheers - jamie |