Page 1 of 1

BillboardSet::setMaterialName () Fails

Posted: Mon Feb 14, 2005 11:54 am
by y721
Hi:

My code used to work on v0.15. It fails on v1.0 RC now.
I am sure the material file is there, and the name is correct.
I guess Ogre doesn't load the material for me.


The log file shows the error.

Error #: 7
Function: BillboardSet::setMaterialName
Description: Could not find material Examples/FlyingLightMaterial.
File: d:\dragon\ogre\ogrenew\ogremain\src\ogrebillboardset.cpp
Line: 271
Stack unwinding: <<beginning of stack>>


My code.

Code: Select all

BillboardSet	* m_pLightBbs = m_pSceneMgr->createBillboardSet("LightBillboardSet");		
  m_pLightBbs->setMaterialName("Examples/FlyingLightMaterial");	


My setup resource code similar to ExampleApplication:

Code: Select all

void OgreEngine::SetupResources()
{
  // Load resource paths from config file
  ConfigFile cf;
  cf.load("resources.cfg");

  // Go through all settings in the file
  ConfigFile::SettingsIterator i = cf.getSettingsIterator("General");

  ResourceGroupManager::getSingleton().initialiseAllResourceGroups();

  String typeName, archName;
  while (i.hasMoreElements())
  {
    typeName = i.peekNextKey();
    archName = i.getNext();
    ResourceGroupManager::getSingleton().addResourceLocation(archName, typeName, "general");
  }
}
My resource.cfg file:

Code: Select all

[Bootstrap]
Zip=./Media/packs/OgreCore.zip
Zip=./Media/packs/skybox.zip

# Resource locations to be added to the default path
[General]

# !!! Application specific
FileSystem = Media/Terrains
FileSystem= ./Media/dragonmodels

#Ogre Directories 

FileSystem=./Media
FileSystem=./Media/models
FileSystem=./Media/fonts
FileSystem=./Media/overlays

FileSystem=./Media/materials/programs
FileSystem=./Media/materials/scripts
FileSystem=./Media/materials/textures
Do I have to use ['groupname'] to load the necessary resources?

Thank you in advance.

Steve

Posted: Mon Feb 14, 2005 12:01 pm
by haffax
Not sure, but I think you should call initialiseAllResourceGroups() after you added the resource locations.