[2.1] How does Ogre's AUTODETECT_RESOURCE_GROUP_NAME work Topic is solved

Problems building or running the engine, queries about how to use features etc.
Post Reply
123iamking
Gremlin
Posts: 152
Joined: Sat Aug 12, 2017 4:16 pm
x 4

[2.1] How does Ogre's AUTODETECT_RESOURCE_GROUP_NAME work

Post by 123iamking »

I have read about Ogre::ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME and I see that this somehow automatically finds resource.

In the sample project Sample_V2Mesh of Ogre 2.1 has the following code

Code: Select all

//Load the v1 mesh. Notice the v1 namespace
	//Also notice the HBU_STATIC flag; since the HBU_WRITE_ONLY
	//bit would prohibit us from reading the data for importing.
	v1Mesh = Ogre::v1::MeshManager::getSingleton().load(
		"athene.mesh", Ogre::ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME,
		Ogre::v1::HardwareBuffer::HBU_STATIC, Ogre::v1::HardwareBuffer::HBU_STATIC);


I try to re-create the sample project Sample_V2Mesh from scratch, but when I come to that code, OGRE said he can't find "athene.mesh". I have put the file "athene.mesh" into DebugPack.zip. I have added the 'models' folder which contains the file "athene.mesh" and put the path inside the file resources2.cfg.

Code: Select all

[Essential]
Zip=../Data/DebugPack.zip

[Popular]
FileSystem=../Data
FileSystem=../Data/Materials/Common
FileSystem=../Data/Materials/Common/GLSL
FileSystem=../Data/Materials/Common/HLSL
FileSystem=../Data/Materials/Common/Metal
FileSystem=../Data/models


# Do not load this as a resource. It's here merely to tell the code where
# the Hlms templates are located
[Hlms]
DoNotUseAsResource=../Data

Code: Select all

OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource athene.mesh in resource group Autodetect or any other group. in ResourceGroupManager::openResource at E:\\Source\\OgreSDK\\OgreMain\\src\\Ogr...
Maybe I did do it wrong at some steps, therefore, I want to understand how AUTODETECT_RESOURCE_GROUP_NAME find its resource, so that I can focus on that point and debug it.

Thanks for reading.
IndieGuy11
Halfling
Posts: 50
Joined: Fri May 19, 2017 8:09 pm
x 2

Re: [2.1] How does Ogre's AUTODETECT_RESOURCE_GROUP_NAME wor

Post by IndieGuy11 »

Does it work if you manually add it:

Code: Select all

Ogre::ResourceGroupManager::getSingleton().addResourceLocation(AbsoluteLocationZipFile, "Zip", Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
Dont forget to:

Code: Select all

Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups(true);
We moved away from the resource file that comes with ogre.
123iamking
Gremlin
Posts: 152
Joined: Sat Aug 12, 2017 4:16 pm
x 4

Re: [2.1] How does Ogre's AUTODETECT_RESOURCE_GROUP_NAME wor

Post by 123iamking »

IndieGuy11 wrote:Does it work if you manually add it:

Code: Select all

Ogre::ResourceGroupManager::getSingleton().addResourceLocation(AbsoluteLocationZipFile, "Zip", Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
Dont forget to:

Code: Select all

Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups(true);
We moved away from the resource file that comes with ogre.
Thank you very much, it works! :D
Post Reply