First concerns with Python-Ogre

Xylankant

02-08-2009 12:16:10

Hi everyone!

I'm new to Python-Ogre and to this forum, so I hope you're not too mad at me for posting this as a first post (also, I'm not english, so please forgive my making mistakes here and there ;) )
As I'm trying to learn how to program using Ogre, I'm currently working myself through the wiki's tutorials and so far everything worked out fine.

However, I've reached tutorial 5 now (http://wiki.python-ogre.org/index.php/Basic_Tutorial_5) and there's this remark right at the top stating that it isn't up to date.
So I follow that remark, reading through the post stating that one should take a look at Demo_Spinner.py in order to get an idea of how buffered input works.

Thing is Demo_Spinner wouldn't even start for me ^^

When running it from the command line, I'll get this:
Traceback (most recent call last):
File "Demo_Spinner.py", line 209, in <module>
main()
File "Demo_Spinner.py", line 194, in main
app = MyApp()
File "Demo_Spinner.py", line 35, in __init__
self._choose_render_engine()
File "Demo_Spinner.py", line 71, in _choose_render_engine
self.root.setRenderSystem(rend_list[-1])
IndexError: get


So I'm having a look at the source, finding the corresponding call:
def _choose_render_engine(self):

# for now this forces D3D
rend_list = self.root.getAvailableRenderers()
self.root.setRenderSystem(rend_list[-1])


From what I understand from reading the API, self.root.getAvailableRenderers() shoud return the render systems available on my machine, that's fair enough.
However, when I'm adding a
print len(rend_list)
for "debugging", it prints a "0", so the list is empty...how can that be?

When running other demos, everything's fine, I've got to chose the render system I want to use (DirectX or openGL) and the demo starts off. So I guess those other demos don't use that _choose_render_engine method.

Well, long story short the question is: How do I get Demo_Spinner up and running?

My system is running Win XP, so DX is available (I understand that under Linux it wouldn't work because D3D isn't available, but it is for me...)
I'm using Python-Ogre 1.6.1 building on Python 2.6 (installed the Python-Ogre binary first and then applied the patch for python 2.6)

I really hope someone out there is able to help me with that, I'd hate skipping that tutorial/part of the tutorial just because a Demo just won't work (and of course I'd really like being able finding out what render systems are available on a given machine anyhow ^^)

Cheers,
Xylankant

andy

02-08-2009 14:04:54

Problem is that demo_spinner wasn't updated in the last major change and I missed the fact it was broken.. Issue is that I moved the plugins.cfg file and renamed it for the demos so it's not finding it, hence doesn't know what render drivers to load..

You can fix it by making the following change:
def main():
app = MyApp(plugins_path='../plugins.cfg.nt')


Andy

Xylankant

02-08-2009 14:18:08

Hey, nice one :)

Changed it and it works now, cheers!