Page 1 of 1

[SOLVED]Cannot locate mesh after compiling

Posted: Thu Jul 21, 2005 9:56 pm
by gattu_marrudu
I have compiled my first executable with OGRE (on Linux), and all looked fine.
But when I launch the application, after the video mode selection GUI, I get the following error:

Code: Select all

Parsing script OgreLoadingPanel.overlay
Finished parsing scripts for resource group 
Parsing scripts for resource group General
Finished parsing scripts for resource group General
Mesh: Loading ingrao01.mesh.
An exception has occured: An exception has been thrown!

-----------------------------------
Details:
-----------------------------------
Error #: 8
Function: ResourceGroupManager::openResource
Description: Cannot locate resource ingrao01.mesh in resource group General.. 
File: OgreResourceGroupManager.cpp
Line: 499
Stack unwinding: <<beginning of stack>>
*-*-* OGRE Shutdown
etc.

It doesn't seem related to the resources.cfg file, as it points right to the directory where the mesh is. And besides, it seems to load other resources, like bitmaps.

Could it be something missing in my code? I'm using the provided ExampleApplication.h and ExampleFrameListener.h.

These are the lines of the .cpp file which could be interested in the error:

Code: Select all

void createScene(void)
    {
        Entity* thisEntity = mSceneMgr->createEntity("nameInTheScene", "ingrao01.mesh");
        mSceneMgr->setAmbientLight(ColourValue(1, 1, 1));
        SceneNode* thisSceneNode = static_cast<SceneNode*>(mSceneMgr->getRootSceneNode()->createChild());
        thisSceneNode->attachObject(thisEntity);
        thisSceneNode->roll(Degree(90));
        thisSceneNode->yaw(Degree(90));
        mCamera->setPosition(Vector3(0,-200,-600));
        mCamera->lookAt(Vector3(0,-200,500));
    }

Re: Cannot locate mesh after compiling

Posted: Thu Jul 21, 2005 10:45 pm
by jacmoe
gattu_marrudu wrote:It doesn't seem related to the resources.cfg file, as it points right to the directory where the mesh is. And besides, it seems to load other resources, like bitmaps.
Well, this does look like it's related to the resources.cfg file.
Did you put that .mesh file in the models directory?
What's written in that resources.cfg of yours?
Even if everything looks right, it could be wrong.

((This is on Linux - so (I could be wrong here) did you set the correct file permissions on your mesh file?))

Posted: Fri Jul 22, 2005 7:08 am
by gattu_marrudu
Here is my resources.cfg:

Code: Select all

FileSystem=./
FileSystem=../Media
FileSystem=../Media/fonts
FileSystem=../Media/materials/programs
FileSystem=../Media/materials/scripts
FileSystem=../Media/materials/textures
FileSystem=../Media/models
#FileSystem=../Media/overlays
#FileSystem=../Media/particle
#Zip=../Media/packs/cubemap.zip
#Zip=../Media/packs/cubemapsJS.zip
#Zip=../Media/packs/dragon.zip
#Zip=../Media/packs/fresneldemo.zip
Zip=../Media/packs/OgreCore.zip
#Zip=../Media/packs/ogretestmap.zip
#Zip=../Media/packs/skybox.zip 
The .mesh file and the models folder are created by me and they have all the permissions for their owner (me). I also tried to put a mesh from the samples directory and to add it to the .cpp file, but it cannot be found either.
Another thing: I didn't write the code, but somebody else wrote it for me for OGRE 0.15, now I'm using 1.0.3. As I first tried to compile, it complained about a missing "Plugin_fileSystem", which actually doesn't exist. So I removed its reference in the plugins.cfg:

Code: Select all

# Define plugin folder
PluginFolder=/usr/local/lib/OGRE

# Define plugins
#Plugin=RenderSystem_Direct3D7
#Plugin=RenderSystem_Direct3D9
Plugin=RenderSystem_GL
#Plugin=Plugin_FileSystem
Plugin=Plugin_ParticleFX
Plugin=Plugin_BSPSceneManager
Plugin=Plugin_OctreeSceneManager
#Plugin=Plugin_GuiElements
#Plugin=Plugin_NatureSceneManager
Plugin=Plugin_CgProgramManager 
Is it right?

Posted: Fri Jul 22, 2005 12:10 pm
by gattu_marrudu
Ok, I have solved it, though dunno precisely how... my programming skills are so poor, and I think the file resource.cfg was the point. I just replaced it with the one provided with the Samples, and it runs.