[solved] Accessing materialManager with wxogre

chpod

27-03-2008 12:20:57

Hi all,

I am working with Demo_WX.py.

From DemoFrame.__init__, i have access to the sceneManager with self.ogreWin.sceneManager.

However, I have no idea how I could access the materialManager from the same place.

(I am trying to fill a combo box with all available material names).

Any idea?

chpod

chpod

28-03-2008 09:36:23

We'll, let's answer to myself! ;)

getSingleton() was the key.

# Set a list of all available materials inside a combobox
materialList = [];

materialManager = ogre.MaterialManager.getSingleton()
matIt = materialManager.getResourceIterator();
while (matIt.hasMoreElements()):
mat = matIt.getNext();
materialList.append(mat.getName())

self.materialCombo = wx.ComboBox(self, -1, "default", size = (200,-1), choices = materialList);

skorpio

07-05-2008 03:16:48

Hello,

I was able to your solution to my problem. I was trying to get the the elements within an overlay resource.

Thanks, for posting a response

Skorpio