Help with wiki tutorial 1

Rhodium

12-10-2008 17:48:17

I'm having trouble with my very first program in PythonOgre. Here's what happened:

I installed the pre-compiled version of PythonOgre.
I should already have OpenGL installed (I've used it in programs before), but I had to install the latest version of DirectX (DXSDK_Aug08.exe) before any of the demos worked. Now it seems that every demo works perfectly. In the "OGRE Engine Rendering Setup" that appears every time I run a demo, it doesn't matter whether I use the OpenGL or DirectX renderers.

I went to http://wiki.python-ogre.org/index.php/Basic_Tutorial_1 and copied the following code:


import ogre.renderer.OGRE as ogre
import SampleFramework as sf

class TutorialApplication(sf.Application):

def _createScene(self):
pass

if __name__ == '__main__':
ta = TutorialApplication()
ta.go()


I saved it as C:\PythonOgre\demos\basic_01.py. The wiki tutorial says I need three files: In the same folder were the required files plugins.cfg and resources.cfg, BUT THERE IS NO FILE MEDIA.CFG ANYWHERE ON MY COMPUTER.

When I run basic_01.py out of IDLE I get the following error:

Traceback (most recent call last):
File "C:\PythonOgre\demos\basic_01.py", line 11, in <module>
ta.go()
File "C:\Python25\lib\site-packages\ogre\renderer\OGRE\sf_OIS.py", line 66, in go
if not self._setUp():
File "C:\Python25\lib\site-packages\ogre\renderer\OGRE\sf_OIS.py", line 90, in _setUp
self.root = ogre.Root(getPluginPath())
OgreInternalErrorException: OGRE EXCEPTION(7:): Could not load dynamic library ../../plugins\RenderSystem_GL.dll. System Error: The specified module could not be found.

in DynLib::load at ..\src\OgreDynLib.cpp (line 80)


I don't even know where to begin fixing this problem. Again, this is my first PythonOgre program so I don't know what any of the code means yet (although I know a bit about Python). This problem still occurs even if in the last demo I ran, I chose to use DirectX and not OpenGL. There exists a file C:\PythonOgre\plugins\RenderSystem_GL.dll.

UPDATE:
It now works when I reinstalled both Python and PythonOgre, put my program inside the folder C:\PythonOgre\demos\OgreNewt, and copied the file SampleFramework.py into that folder as well. Phew!

andy

13-10-2008 12:53:56

Your issue in to do with plugins.cfg -- if you have a look at that you can see that the path to the plugins (includes directx, opengl, etc) is hardcoded..

Based upon the initial test directory (/PythonOgre/demos) you would have had to edit these to point one level up...

I am considering changing the overall build to put the plugins into the module directory and do away with a plugins.cfg for the sampleframework, or at least to try and resolve these types of issues..

Regards
Andy

Vaale

17-06-2009 13:55:00

I had this same trouble as well. Another way to fix it is to copy all the .cfg 's and sampleframework into a new folder for you to work in.

As an aside, how is the plugin.cfg (the one in OgreSDK, right?) supposed to look?