readNodeFile not working

Community support forum for users of the GPL-licensed osgART Standard Edition v1.0 and proprietary-licensed osgART Professional Edition v1.1
arpspatel
Posts: 5
Joined: Sat Apr 03, 2010 12:02 pm

readNodeFile not working

Postby arpspatel » Mon Apr 05, 2010 10:03 am

I am trying to load an ive file using readNodeFile, but the file doesnt get load, every time i get a "false" return from loadedModel.. I checked if it can find plugins or not, it can definately find plugins and also the ive file, tried to load and then says its invalid.. i tried checking the file with osgviewer and it works fine..

Code: Select all

      bool UseCube = false;
      osg::ref_ptr<osg::Node> loadedModel;
      if(markerList.at(i).split(":").at(1) != "UseCube"){
         loadedModel = osgDB::readNodeFile(markerList.at(i).split(":").at(1).toStdString().c_str());
      }else{
         UseCube = true;
      }
      
      //       osg::ref_ptr<osgART::Marker> marker = tracker->addMarker("single;data/patt.hiro;80;0;0");
      osg::ref_ptr<osgART::Marker> marker = tracker->addMarker(_mstr.toStdString().c_str());
      
      if (!marker.valid()) {
            QMessageBox::information(this, tr("Test One"), tr("Marker not valid"));
         return false;
      }
      
      marker->setActive(true);

      osg::ref_ptr<osg::MatrixTransform> arTransform = new osg::MatrixTransform();
      osgART::attachDefaultEventCallbacks(arTransform.get(),marker.get());

      //CallBack coding --Starts Here--
      osg::NodeCallback* mcb = new StatsCallback(marker.get());
      mcb->setNestedCallback(new osgART::MarkerTransformCallback(marker.get()));
      arTransform->addUpdateCallback(mcb);
      if(UseCube){
         arTransform->addChild(CubeTest());
      }else{
         if (!loadedModel) // it always goes into this loop, no idea why.. tried loadedModel.valid() and same result..
         {   
            QMessageBox::information(this, tr("Test Two"), tr("Model Does not exist"));
            return false;
         }
         arTransform->addChild(loadedModel.get());
      }
      arTransform->getOrCreateStateSet()->setRenderBinDetails(100, "RenderBin");
      cam->addChild(arTransform.get());
   }



I am not sure why it does this way, it works perfectly fine in the osgviewer, but doesnt work in my app.. do i have to include or define a special files/parameters into this..

I am using Qt 4.6.2, Visual Studio 2008 and osgART 2.0 RC3.. please help

Thanks

arpspatel
Posts: 5
Joined: Sat Apr 03, 2010 12:02 pm

Re: readNodeFile not working

Postby arpspatel » Mon Apr 05, 2010 10:47 am

Code: Select all

FindFileInPath() : trying C:\ArpsFramework\OpenSceneGraph\bin\osgPlugins-2.8.2\osgdb_ive.dll ...
FindFileInPath() : USING C:\ArpsFramework\OpenSceneGraph\bin\osgPlugins-2.8.2\osgdb_ive.dll
DynamicLibrary::failed loading "osgPlugins-2.8.2/osgdb_ive.dll"


tried the OSG_NOTIFY_LEVEL = DEBUG

and it seems like it finds the library but cannot load it..
Can this be fixed??

arpspatel
Posts: 5
Joined: Sat Apr 03, 2010 12:02 pm

Re: readNodeFile not working

Postby arpspatel » Mon Apr 05, 2010 11:02 am

Ok... I found it.. it was missing three files the osgdb_ive.dll depends on..

osgFX, osgSim and osgTerrian dll files... just copied it and works perfect...

DanDanGong
Posts: 1
Joined: Wed Aug 18, 2010 7:18 am

Re: readNodeFile not working

Postby DanDanGong » Wed Aug 18, 2010 7:21 am

Hi there,

I seem to be experiencing a similar proble. However i have osgSim,osgFx,osgVolume and osgTerrain in the same folder as osgdb_ive.

Still when my osg QT application tries to load the ive file it just crashes. I am not sure what else to try at the moment. Any advice?

Laura50
Posts: 2
Joined: Sun Feb 20, 2011 6:41 pm

Re: readNodeFile not working

Postby Laura50 » Wed Feb 23, 2011 12:58 am

I'm not finding a concrete solotion to this either, have been scouring google for days and this is the only place I've found even remotely close to covering the same issues... :?


Return to “[ARCHIVED] osgART Standard & Professional Editions”

Who is online

Users browsing this forum: No registered users and 2 guests