Error when running tutorial code


12-12-2006 13:32:53

Sorry for the noob question. I looked all over the forum and saw a bunch of problems relating to the tutorials, but none of them match the one I am having. (Running WinXP btw)

I have PyOgre 1.2 and the correct demo media archive. PyOgre is in C:\python24\lib\site-packages\pyogre and the demos are in C:\python24\pyogre\pyogre_demos.

It gets through initializing the config window and everything fine, but afterwards, I get this error in the console:

Traceback (most recent call last):
File "", line 72, in ?
File "C:\Python24\pyogre\pyogre_demos\tutorials\", line 23, in go
if not self._setUp():
File "C:\Python24\pyogre\pyogre_demos\tutorials\", line 39, in _setUp
File "C:\Python24\pyogre\pyogre_demos\tutorials\", line 79, in _chooseSceneManager
self.sceneManager = self.root.getSceneManager(ogre.ST_GENERIC)
File "C:\Python24\lib\site-packages\pyogre\", line 18702, in getSceneManager
return _ogre.Root_getSceneManager(*args)
TypeError: in method 'Root_getSceneManager', argument 2 of type 'Ogre::String const &'

Don't know what the deal is, but I don't seem to be doing anything wrong. Anyone know? Thanks!


13-12-2006 09:16:32

Looks like the old pyogre1.6 or pyogre1.2 problem to me.

look for the 'getSceneManager' line in either the sample framework or the tutorial code (from the error, i can see its line 79 in the sampleframework). For pyOgre1.2 you need to 'name' the scenemanager, so it should say something like:

self.sceneManager = self.root.createSceneManager(ogre.ST_GENERIC, "sm")

You need to have a string as the second argument in the scenemanager constructor. From the error you've posted, that looks like the solution to me :), hope it solves it for you.


13-12-2006 10:51:39

Hey, thanks a lot! That worked.

Might I suggest that someone modify the wiki (or better yet, the demo_media distribution) to reflect this? Thanks again.

I look forward to joining the OGRE community. :)