dynamically updating the Scene

Sep 9, 2010 at 9:31 AM
Edited Sep 9, 2010 at 9:36 AM

Hi i need to update a scene at runtime, so i have tried code like this:

 	theGame.Scene.Clear();
            theGame.Scene.AddNode(_lightSource);// seems like _lightSource keeps knowledge of context !!
            theGame.Scene.AddNode(_geometryObject);
            theGame.Scene.AddNode(_boundingBox);
            theGame.Scene.AddNode(_origo);
            theGame.Camera = _camera;
            theGame.Scene.Prepare(theGame.Viewport);

But i get an error about _lightSource node - Element is already the child of another element.

is this a bug or am i mis using the api somehow ?

i also need a way to resize, is this possible somehow ?

i'm using balder source da7dc7bccc74

thanks in advance

Coordinator
Sep 9, 2010 at 10:12 AM

This is a bug. 

There are multiple collections being maintained and its not removed from one of them

Coordinator
Sep 9, 2010 at 10:12 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Oct 13, 2010 at 7:26 PM

I'm also seeing a related memory leak. If I add a geometry as the child of another geometry, then remove it, something inside Balder is not letting go. I can't re-use the child geometry because I get "Element is already the child of another element." And even if I get rid of all my references to the child geometry, the garbage collector never frees up the memory. This is version 8.8.9. Thanks!

Coordinator
Oct 13, 2010 at 9:37 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Coordinator
Oct 15, 2010 at 10:15 PM

I believe this is now fixed in this changeset.