Marco Cosentino wrote:
Hi,
I have a problem (maybe a bug?) in loading a .dae file made with Blender collada exporter.
I'm writing a robot simulation software that uses collada to load both 3d and physics.
The error I get is an exception :
"Unhandled exception at 0x0049fb10 (msvcr80d.dll) in RobotSimulator.exe: 0xC0000005: Access violation reading location 0x00000000."

This occours when I try to load the collada file. Here is the code I wrote:

Code:
bool VisualModel::CreateFromColladaFileAndFillDAE(std::string & filename,DAE *dae)
{
   osg::ref_ptr<osgDB::ReaderWriter::Options> rwoptions(new osgDB::ReaderWriter::Options());
   rwoptions->setPluginData("DAE",dae);
   modelnode = osgDB::readNodeFile(filename,rwoptions);
   if(!modelnode) return false;
   return true;
}



Here is the stack trace:

Code:
  
	msvcr80d.dll!strlen(unsigned char * buf=0x0012e760)  Line 81	Asm
    
 	msvcp80d.dll!std::char_traits<char>::length(const char * _First=0x00000000)  Line 559 + 0x9 bytes	C++
 	msvcp80d.dll!std::basic_string<char,std::char_traits<char>,std::allocator<char> >::assign(const char * _Ptr=0x00000000)  Line 1042 + 0x9 bytes	C++
 	msvcp80d.dll!std::basic_string<char,std::char_traits<char>,std::allocator<char> >::operator=(const char * _Ptr=0x00000000)  Line 893	C++
 	osg55-osgd.dll!osg::Object::setName(const char * name=0x00000000)  Line 102 + 0x21 bytes	C++
 	osgdb_daed.dll!osgdae::daeReader::processSinglePPrimitive<domTriangles>(osg::Geode * geode=0x05c08620, domTriangles * group=0x05c1cbe8, std::map<daeElement *,osgdae::domSourceReader,std::less<daeElement *>,std::allocator<std::pair<daeElement * const,osgdae::domSourceReader> > > & sources=[2](...,...), unsigned int mode=4)  Line 243 + 0x14 bytes	C++
 	osgdb_daed.dll!osgdae::daeReader::processGeometry(domGeometry * geo=0x05c1a3e8)  Line 219	C++
 	osgdb_daed.dll!osgdae::daeReader::processInstanceGeometry(domInstance_geometry * ig=0x05c1ee98)  Line 47 + 0xc bytes	C++
 	osgdb_daed.dll!osgdae::daeReader::processNode(domNode * node=0x05c1e310)  Line 366 + 0x22 bytes	C++
 	osgdb_daed.dll!osgdae::daeReader::processVisualScene(domVisual_scene * scene=0x05c1dd58)  Line 156 + 0x23 bytes	C++
 	osgdb_daed.dll!osgdae::daeReader::convert(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & fileURI="./simpleworld.dae")  Line 123 + 0xc bytes	C++
 	osgdb_daed.dll!ReaderWriterDAE::readNode(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & fname=".\simpleworld.dae", const osgDB::ReaderWriter::Options * options=0x05c07100)  Line 65 + 0x12 bytes	C++
 	osg55-osgDBd.dll!osgDB::Registry::ReadNodeFunctor::doRead(osgDB::ReaderWriter & rw={...})  Line 1399 + 0x40 bytes	C++
 	osg55-osgDBd.dll!osgDB::Registry::read(const osgDB::Registry::ReadFunctor & readFunctor={...})  Line 1537 + 0x22 bytes	C++
 	osg55-osgDBd.dll!osgDB::Registry::readImplementation(const osgDB::Registry::ReadFunctor & readFunctor={...}, bool useObjectCache=false)  Line 1645 + 0x13 bytes	C++
 	osg55-osgDBd.dll!osgDB::Registry::readNodeImplementation(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & fileName=".\simpleworld.dae", const osgDB::ReaderWriter::Options * options=0x05c07100)  Line 1850 + 0x57 bytes	C++
 	osg55-osgDBd.dll!osgDB::Registry::readNode(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & fileName=".\simpleworld.dae", const osgDB::ReaderWriter::Options * options=0x05c07100, bool buildKdTreeIfRequired=true)  Line 237 + 0x98 bytes	C++
 	osg55-osgDBd.dll!osgDB::readNodeFile(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & filename=".\simpleworld.dae", const osgDB::ReaderWriter::Options * options=0x05c07100)  Line 69 + 0x1f bytes	C++
 	RobotSimulator.exe!RobotSimulator::VisualModel::CreateFromColladaFileAndFillDAE(std::basic_string<char,std::char_traits<char>,std::allocator<char> > & filename=".\simpleworld.dae", DAE * dae=0x0012f958)  Line 10 + 0x15 bytes	C++
 	RobotSimulator.exe!RobotSimulator::Simulable::LoadModel(RobotSimulator::Model model={...})  Line 21 + 0x16 bytes	C++
 	RobotSimulator.exe!RobotSimulator::Simulator::LoadSimulation(const char * pfilename=0x05b4d9c1)  Line 93 + 0x28 bytes	C++
 	RobotSimulator.exe!main(int argc=2, char * * argv=0x05b4d968)  Line 54 + 0x20 bytes	C++
 	RobotSimulator.exe!__tmainCRTStartup()  Line 586 + 0x19 bytes	C
 	RobotSimulator.exe!mainCRTStartup()  Line 403	C
 	kernel32.dll!7c817077() 	




The collada model is made by Blender 2.48a using the default startup scene with the cube with assigned a green material and esported with Triangles option and DisablePhisics option (for testing). You can find it in attachments.
Note that with collada-dom viewer the model is loaded adn displayed correctly and with osgviewer the model is loaded witout exceptions but nothing is displayed into the scene.

I think the problem is related to the call (you can see in the stack trace)
osg55-osgd.dll!osg::Object::setName(const char * name=0x00000000)� Line 102 + 0x21 bytes

Can you tell me why this appens and how to correct ?

Thank you!!
Bye :D

  
The safety check on the material name not being NULL seems to have disappeared at SVN revision 9228.

Roger
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to