Hi Martin,

Martin Röder wrote:

Hi again,

I just found out that when I do this change:

On Saturday 19 November 2005 12:37, Martin Röder wrote:
If I change the order of the scene creation commands from

       TerrainPtr terrain = Terrain::create();
       ImagePtr height = Image::create();
       beginEditCP(height);
       height->set(Image::OSG_L_PF,5,5);
       height->clear(0);
       height->getData()[7]=16;
       endEditCP(height);
       beginEditCP(terrain);
       terrain->setHeightData(height);
       endEditCP(terrain);
       scene = Node::create();
       beginEditCP(scene);
       scene->setCore(terrain);
       endEditCP(scene);
to
       ImagePtr height = Image::create();
       beginEditCP(height);
       height->set(Image::OSG_L_PF,5,5);
       height->clear(0);
       height->getData()[7]=16;
       endEditCP(height);
       TerrainPtr terrain = Terrain::create();
       beginEditCP(terrain);
       terrain->setHeightData(height);
       endEditCP(terrain);
       scene = Node::create();
       beginEditCP(scene);
       scene->setCore(terrain);
       endEditCP(scene);

i.e. the terrain object is created after the image editing is finished,
everything else is the same, then the loading of the resulting BIN file
crashes at a different location. Actually, the Image data is read before
the Terrain data in this case (as it should be), but something else goes
wrong.

to my cluster program, then it works.
Hm, that sounds strange. AFAIK the order of ::create calls determines the internal id the FieldContainer object gets. Then if the FieldContainer objects are recreated in sequence of their ids, it might happen that one is undefined in the first code piece.
Is that correct?

Loading a BIN file that was created from the Terrain scene still does not work, but I currently don't need this.

Did you try an OSB file?
I will look into this. Perhaps I made a mistake in the Terrain::changed method, which is the place to react to field changes (after endEditCP) and it can get very complex with many fields and field dependencies.


However, I still think there meight be some problem in the serialization routines, or is it normal that it is sensitive to such small changes?
Regards,
Christoph




-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.  Get Certified Today
Register for a JBoss Training Course.  Free Certification Exam
for All Training Attendees Through End of 2005. For more info visit:
http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to