Load/Save scene

Load/Save scene

Post by Patricio Mu? » Fri, 04 Jul 2003 00:04:46



Hi all,

I would like to give my application the opportunity to load and save
the content (scene) of my Examiner Viewer. I use two functions:
OnGuardar (in order to save the scene to an .iv file) and OnAbrir (to
load the scene previously stored in th e .iv file).

I get the .iv file but when trying to display it into the viewer, it
doesn't work. These are the two functions:

void CProyectoDlg::OnGuardar()
{
        // TODO: Add your command handler code here
        SoOutput *pFile = new SoOutput;
        pFile->openFile("modelos/escena.iv");

        SoWriteAction *pSaveScene = new SoWriteAction(pFile);
        pSaveScene->apply(root);

Quote:}

void CProyectoDlg::OnAbrir()
{
        // TODO: Add your command handler code here
        SoInput mySceneInput;
        if (!mySceneInput.openFile("modelos/escena.iv")) {
                fprintf(stderr, "Cannot open file %s\n", "modelos/escena.iv");
        }

        // Read the whole file into the database
        SoSeparator *myGraph = SoDB::readAll(&mySceneInput);

        mySceneInput.closeFile();
        viewer->setSceneGraph(myGraph);

Quote:}

Root is a SoGroup node which the top of the scene graph.

Does anybody know what's wrong?

Is there an easier way to do this?

Thanks in advance,

Patrick

 
 
 

1. New User - Saving Scenes (not saving surfaces)

I am trying to learn Character animation with Lightwave 5.5 and have been
doing exercises from the lightwave power guide.

Currently I have a model which has a standard grey surface called SKIN to
which I have applied a texture called LIZARDSKIN.SRF.

I see the model rendered with the LIZARDSKIN.SRF texture  and am able to
save it.  However when I clear and reload or restart and re load the
LIZARDSKIN.SRF texture is missing and I see only the standard grey SKIN
surface.

Thanks in advance for any help with this problem.

John Peel

2. MEDIA CLEANER PRO 4.0--Half $!

3. Loading of files and scene graph using Performer

4. Problem when stretchdrawing a bitmap at Run-time

5. error message on scene load

6. Newbie question re: overlapping 2D graphics

7. CharacterStudio Crash After Re-Loading Scene ?

8. load scene with Plugin

9. Problems in schematic view loading items from scene

10. quicktime vr errors on loading scene in 6.5

11. HELP: I can't load my scene with rigged chracters and IK

12. Load Scene?