BillboardSet::setMaterialName () Fails

Problems building or running the engine, queries about how to use features etc.
Post Reply
User avatar
y721
Gremlin
Posts: 153
Joined: Mon Nov 08, 2004 3:15 am
Location: Taiwan

BillboardSet::setMaterialName () Fails

Post 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
User avatar
haffax
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4823
Joined: Fri Jun 18, 2004 1:40 pm
Location: Berlin, Germany
x 8
Contact:

Post by haffax »

Not sure, but I think you should call initialiseAllResourceGroups() after you added the resource locations.
team-pantheon programmer
creators of Rastullahs Lockenpracht
Post Reply