Code Snippets - Minimal Application Incomplete

EvanPMeth

20-07-2008 19:30:25

Alright im pretty new to python-ogre coming from panda3D.
I stumbled upon the Minimal application http://wiki.python-ogre.org/index.php/CodeSnippets_Minimal_Application which has the basic concepts of basic tutorial 5 and 6. When running it i found this problem with it. It was missing this method:

def convertButton(self,oisID):
if oisID == OIS.MB_Left:
return CEGUI.LeftButton
elif oisID == OIS.MB_Right:
return CEGUI.RightButton
elif oisID == OIS.MB_Middle:
return CEGUI.MiddleButton
else:
return CEGUI.LeftButton


and proper calls to it in the following (missing self. )

def mousePressed(self, evt, id):
# Handle any CEGUI mouseButton events
CEGUI.System.getSingleton().injectMouseButtonDown(self.convertButton(id))
return True

def mouseReleased(self, evt, id):
# Handle any CEGUI mouseButton events
CEGUI.System.getSingleton().injectMouseButtonUp(self.convertButton(id))
return True


This fixed the missing method problem but when running it, it just freezes when any button is pressed. Then i have to force quit.

My first guess is this code is outdated but its stamped "Alex de Landgraaf, 2008".
I am using python25 and python-ogre 1.1 windows

skorpio

20-07-2008 22:27:26

Hello Evan

Welcome to python-ogre. It is a great graphical engine but tools are limited. The code snips, basic apps, sample code are usually unmaintained with too many bugs to be useful so I started working on a new implementation called:
wxOgreFramework.

The main object here is to provide tools to support python-ogre using wxWidget. wxWidget gives a windows look to the python-ogre. The framework also provides a way to create create applications without it.
The whole approach is minimal and modular in concept.

An overview can be here
http://myfreefilehosting.com/f/5ba5326abb_0.1MB

The main forum thread for the wxOgre project is here:
http://www.ogre3d.org/phpBB2addons/viewtopic.php?t=7134


You can download the code from there (rev15b). There are a few demos that can be generated.

rev15 with demos
http://www.mediafire.com/?guzncxmojwd

You'll need to wxWidgets and place the code in the demos folder where the rest of the code is. I personally used the name wxOgre for my folder.

I'll be happy to help you setup your environment and explain how things work. Hopefully after evaluation, you will find that this can useful for you.

As far as your issue is concern, I will take a look at it and post a reply later.

Thanks

skorpio

21-07-2008 00:41:07

Hello,

I had a look at the code, it seems the problem is coming from the cleanup function. I just commented it out and I let python clean it up.

I added an ogre head. Here is the updated code.

http://www.mediafire.com/?1mj3mmjymbm

Thanks,

EvanPMeth

21-07-2008 01:06:00

Thanks Scorpio :D

Community support for Ogre is amazing.

alextreme

23-07-2008 16:28:15

Sorry for missing that function, thanks for fixing it skorpio!