When you used the debugger to look at the filename did it have the path to the 
file or just the filename?  If it was just the filename I would say the it is 
looking in the current directory for your file but not finding it.  If it 
contains the full path to the file then I am not sure what could be causing the 
problem.  You might try commenting out the call to optimize the model and see 
if that helps.
 
Mike Hartman

________________________________

From: [EMAIL PROTECTED] on behalf of Ricko 3D
Sent: Tue 8/28/2007 12:41 PM
To: [email protected]
Subject: Re: [osg-users] osgviewerMFC example crash in 2.1.8



By the way, to clarify when I wrote cOSG::InitSceneGraph ("MFC_OSG.cpp") I 
meant it was in the MFC_OSG.cpp file, not that it was a parameter passed. I 
didn't realize how poorly I wrote that until reading the mail again. Sorry. 
That isn't the issue I'm trying to resolve.

 

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ricko 3D
Sent: Tuesday, August 28, 2007 1:19 PM
To: [email protected]
Subject: [osg-users] osgviewerMFC example crash in 2.1.8

 

I'm still finding my way around OSG so I wanted to find out if this issue is 
mine before I continue pulling my hair out. 

 

I downloaded and built OSG 2.1.8. I took the code from one of the examples to 
test, prior to integrating OSG into my app. This is on WinXP SP2 x86 and the 
dev env is VC++ in VS8.

 

- I created a new project using the code from the "osgViewerMFC" example. 

- It compiled fine in both release and debug and it launches with no issues.

- When I use the open command (from menu or toolbar) and direct it to any test 
osg file, it crashes with both debug and release builds.

- I used the VS debugger to walk through and find the crash in the debug build.

- Line 143 of "optimizer.cpp" caused an unhandled exception because node was a 
NULL point.

- I walked up the call stack back into the osgViewerMFC code and found the 
cause is that mModel in cOSG::InitSceneGraph ("MFC_OSG.cpp") is also NULL.

- It turns out osgDB::readNodeFile, earlier in InitSceneGraph, returned a NULL 
mModel even though the filename passed was valid.

 

To verify it wasn't my settings when creating the example project from scratch 
I chose another example, specifically osgShadow example. I created a new 
project added the source, compiled, and both debug and release work perfectly.

 

Is this a known issue with osgViewerMFC? If not any suggestion on what might be 
causing it?

 

Thanks!

Ricko

<<winmail.dat>>

_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to