PyOgre -Now using Swig, new bindings, new home, new release!

Anything and everything that's related to OGRE or the wider graphics field that doesn't fit into the other forums.
Locked
stodge
Goblin
Posts: 217
Joined: Thu Oct 24, 2002 4:12 am
x 1
Contact:

Post by stodge »

Where are the samples for the pyogre download (from the OGRE site)?
the_python
Gnoblar
Posts: 10
Joined: Fri Mar 04, 2005 1:41 pm

Post by the_python »

I'm not sure. I have a plan that in the distant future there will be some kind of physics integration. My original idea was to start work on a PyODE once ogre/cegui were stable and usable. However, monster has said he is stopping work on ODE to work on its replacement. Someone has also been talking to me about working on a Newton wrapper for python (though I don't know how far he's gotten with it).
If I understand you correctly, you mean this?:

http://pyode.sourceforge.net/

or you mean a PyOgreOde?
User avatar
Clay
OGRE Community Helper
OGRE Community Helper
Posts: 518
Joined: Wed Mar 17, 2004 4:14 am
Contact:

Post by Clay »

stodge wrote:Where are the samples for the pyogre download (from the OGRE site)?
They should be included in the ogre release. The installer puts them in [PYTHON23_PATH]\ogre\demos
the_python wrote:If I understand you correctly, you mean this?:

http://pyode.sourceforge.net/

or you mean a PyOgreOde?
Oops, didn't realise there was already a project. No, more of a PyOgreOde. Work has to be done to integrate ODE with Ogre (which monster has already done), so if I did something like that I would bind his wrapper.
stodge
Goblin
Posts: 217
Joined: Thu Oct 24, 2002 4:12 am
x 1
Contact:

Post by stodge »

Clay wrote:
stodge wrote:Where are the samples for the pyogre download (from the OGRE site)?
They should be included in the ogre release. The installer puts them in [PYTHON23_PATH]\ogre\demos
the_python wrote:If I understand you correctly, you mean this?:

http://pyode.sourceforge.net/

or you mean a PyOgreOde?
Oops, didn't realise there was already a project. No, more of a PyOgreOde. Work has to be done to integrate ODE with Ogre (which monster has already done), so if I did something like that I would bind his wrapper.
Oh damn - I was looking under site-packages.

Thanks! :)
stodge
Goblin
Posts: 217
Joined: Thu Oct 24, 2002 4:12 am
x 1
Contact:

Post by stodge »

Will the new bindings be compatible with the old ones? Or would they require source changes to the demos for example?

Thanks
smr
Gnoblar
Posts: 8
Joined: Tue May 10, 2005 9:12 pm

Post by smr »

My understanding is that no, the new bindings will not be compatible with the old ones. The new bindings are a better fit with the python way of doing things.
smr
Gnoblar
Posts: 8
Joined: Tue May 10, 2005 9:12 pm

Post by smr »

Any news on how this is coming along?
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Post by jacmoe »

@smr: Just use it! :)
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
User avatar
fog
Greenskin
Posts: 149
Joined: Sun Sep 19, 2004 6:00 pm
Location: Torino, ITALY
Contact:

Post by fog »

smr wrote:Any news on how this is coming along?
pyogre is already usable and win32 prebuilt binaries will be released shortly.

In the classical Unix tradition no binary packages for Linux, but building (especially if you use the magnificent Ogre for Debian packages :D) is really easy: just make sure you have a new SWIG (1.3.24) and then "python setup.py build".

CEGUI is giving us some headaches. Will come a little bit later.
ibrown
Gremlin
Posts: 164
Joined: Wed Aug 18, 2004 6:41 pm
Location: London
Contact:

Post by ibrown »

The sooner you get some binaries up the better. This is a great piece of work ... especially when used with wxPython. It's a real pain to build though which I think is currently keeping people away.

Ian
User avatar
shaft
Halfling
Posts: 97
Joined: Sun Jan 19, 2003 12:54 am

Post by shaft »

Lack of documentation is whats keeping me away... But I've got 100 other things to work on so I will wait patiently. :wink:
- Shaft (He's a bad motha... Shut yo' mouth)
smr
Gnoblar
Posts: 8
Joined: Tue May 10, 2005 9:12 pm

Post by smr »

ibrown wrote:The sooner you get some binaries up the better. This is a great piece of work ... especially when used with wxPython. It's a real pain to build though which I think is currently keeping people away.

Ian
Yeah, I tried to build it too. First it told me that I didn't have vc6 installed. Then I went to a box that has vc6 and it told me that I needed .net installed. At that point I decided that I could wait.
ibrown
Gremlin
Posts: 164
Joined: Wed Aug 18, 2004 6:41 pm
Location: London
Contact:

Post by ibrown »

I'm sure this is not the best place to ask the question but....

I have wxPython 2.6 installed and the wxDemo does not really work with it. The Ogre configuration screen comes up but then the application just exits. I am guessing it has something to do with the MainLoop function - maybe something has changed since wxPython 2.5.

Do you know about this ... and do you have any idea how to modify it so that it works for 2.6?

Ian
stodge
Goblin
Posts: 217
Joined: Thu Oct 24, 2002 4:12 am
x 1
Contact:

Post by stodge »

Any more information - is there an exception displayed when you it from the console/command line?
ibrown
Gremlin
Posts: 164
Joined: Wed Aug 18, 2004 6:41 pm
Location: London
Contact:

Post by ibrown »

no exceptions on the command line, and nothing unusual in ogre.log.
It looks like the main loop just exits normally ... which is what makes me think it may be a wxPython 2.6 migration issue. The script is reported to work on wxPython 2.5 .... but I only have 2.6 here.

Ian
Istari
Kobold
Posts: 27
Joined: Sun Mar 27, 2005 12:04 am
Location: Iceland
Contact:

Post by Istari »

I have been playing around with pyOgre and wxPython and I have created a basic framework for wxPython 2.6 apps using pyOgre. (Edit: removed non-working link)
My idea is to use this for my game content editors. It runs just a bit slower for me than regular pyOgre (c.a. 250 fps vs. 310 fps), but since editors don't really need to be realtime I don't consider that to be too big of an issue.

You may consider this to be version 0.1 since there is little documentation (mostly docstrings). I have modified CameraTrackingDemo.py to work with my code to give an example of how to use it. When run, it also displays a wx.py.shell.ShellFrame. Which contains a variable called appManager in it's local scope.

appManager is a singleton (points to OgreAppManager) and can be used to influence "global" variables. Such as root, camera, sceneManager and viewport.
To use it to toggle display of the debug overlay:

Code: Select all

appManager.debugListener.showDebugOverlay(True)

appManager.debugListener.showDebugOverlay(False)
Last edited by Istari on Thu May 26, 2005 12:25 am, edited 1 time in total.
User avatar
Clay
OGRE Community Helper
OGRE Community Helper
Posts: 518
Joined: Wed Mar 17, 2004 4:14 am
Contact:

Post by Clay »

Very nice Istari. What license are you releasing that code under? If you have no objections I'd like to modify it a bit and include it as a pyogre demo.

I have packaged and released a windows binary installer for python 2.4. You can find it on the pyogre download page. Note that pyogre is in a "beta" state. There's plenty left to do on it, but we are getting very close. This release does not include CEGUI (we are still working out some kinks with it).

Please be SURE to read the readme.txt that is installed to the pyogre/demos directory (this will be in your python24 folder). It explains how to get things up and running.

Note that this release only works for python 2.4. I will build a python 2.3 version in future releases. I don't think fog got the setup script working for linux before I made this release. For anyone using linux you can build the source by checking out the source from anonymous CVS and then following the instructions outlined in the docs/build_linux.txt.

Let me know of any bugs or problems or bugs you run into.

Thanks,
Clay
Istari
Kobold
Posts: 27
Joined: Sun Mar 27, 2005 12:04 am
Location: Iceland
Contact:

Post by Istari »

Thanks. :)

I'm releasing it under BSD, just forgot to add that to the file. By all means use it however you like.

I have updated the zip, it now contains the license. I have also cleaned up the code and written more comments.

It is also accessible from it's subversion repository svn://immersion-monkey.com/wxOgre
Last edited by Istari on Thu May 26, 2005 12:27 am, edited 1 time in total.
ibrown
Gremlin
Posts: 164
Joined: Wed Aug 18, 2004 6:41 pm
Location: London
Contact:

Post by ibrown »

Great work. The Win32 installer works fine for me ... and the wxDemo from Istari also works fine.

On linux, I'm running into a few hurdles though. I have ubuntu 0504 with the source tarball of Ogre 1.0.1 compiled and installed. No special options, just a ./configure; make; make install.

I also have the latest subversion version of pyogre. When I try to build it though, I get the following errors. Any ideas?

Code: Select all

ian@ian:~/src/pyogre/trunk$ ls
AUTHORS    COPYING  docs    sandbox  setup.py        tests
ChangeLog  demos    pyogre  scripts  setup_win32.py
ian@ian:~/src/pyogre/trunk$ swig -c++ -python -modern $(pkg-config --cflags-only-I OGRE) pyogre/ogre/ogre.i
/usr/local/include/OGRE/OgreGpuProgram.h:711: Error: Syntax error in input.
/usr/local/include/OGRE/OgreGpuProgram.h:717: Error: Syntax error in input.
/usr/local/include/OGRE/OgreGpuProgram.h:723: Error: Syntax error in input.
/usr/local/include/OGRE/OgreGpuProgram.h:725: Error: Syntax error in input.
/usr/local/include/OGRE/OgreEntity.h:261: Error: Syntax error in input.
/usr/local/include/OGRE/OgreEntity.h:265: Error: Syntax error in input.
/usr/local/include/OGRE/OgreSceneManager.h:453: Error: Syntax error in input.
/usr/local/include/OGRE/OgreSceneManager.h:455: Error: Syntax error in input.
/usr/local/include/OGRE/OgreParticleSystem.h:62: Error: Syntax error in input.
/usr/local/include/OGRE/OgreParticleSystem.h:69: Error: Syntax error in input.
/usr/local/include/OGRE/OgreParticleSystem.h:76: Error: Syntax error in input.
/usr/local/include/OGRE/OgreParticleSystem.h:83: Error: Syntax error in input.
/usr/local/include/OGRE/OgreParticleSystem.h:90: Error: Syntax error in input.
/usr/local/include/OGRE/OgreParticleSystem.h:97: Error: Syntax error in input.
ian@ian:~/src/pyogre/trunk$ swig -version

SWIG Version 1.3.22
Copyright (c) 1995-1998
University of Utah and the Regents of the University of California
Copyright (c) 1998-2004
University of Chicago
Compiled with g++ [i686-pc-linux-gnu]

Please see http://www.swig.org for reporting bugs and further information
ian@ian:~/src/pyogre/trunk$
Ian
User avatar
Clay
OGRE Community Helper
OGRE Community Helper
Posts: 518
Joined: Wed Mar 17, 2004 4:14 am
Contact:

Post by Clay »

Yep, you have to have at least SWIG version 1.3.24 to generate pyogre bindings. However 1.3.24 has a bug in it that causes problems if there is an error in a C++ callback. You may get segfaults if you have a syntax error in FrameListener.frameStarted, for example.

To fix this the best thing to do is check out SWIG from CVS and use that to generate the bindings. You can use 1.3.24 too, just be careful of errors in C++ callbacks.
User avatar
fog
Greenskin
Posts: 149
Joined: Sun Sep 19, 2004 6:00 pm
Location: Torino, ITALY
Contact:

Post by fog »

Clay wrote:I don't think fog got the setup script working for linux before I made this release.
setup.py works for me but need a lot more testing on non-Debian non-python 2.4 distributions.
Andre_Mikulec
Gnoblar
Posts: 6
Joined: Wed Mar 23, 2005 2:57 pm

Post by Andre_Mikulec »

All,

I downloaded and installed the Python 2.4 pyOgre installer into my Python 2.4. I tried some Python 2.4 demos. In general, the PyOgre is very good so far.

The accompaning comments make the pyOgre distributable somewhat comparable to Panda3D, Soya3D, and pyGame (to some extent).

Hopefully, CEGUI will be available through Python in the future.

Has anyone else, downloaded and installed pyOgre in to Python 2.4 and tried some *.py programs?

What does everyone else think?

AIM
AIM
User avatar
jwatte
Gnome
Posts: 347
Joined: Sat Feb 05, 2005 12:56 am

Post by jwatte »

I'm using PyOgre. It's OK, although debugging is significantly harder than with C++, as I haven't found a good source-level debugger. When something goes wrong, I just get a stack dump from Python, and the stack dump doesn't include the lowest frames -- possibly because native code is involved.

Also, I'm having problems with entity lighting, as reported in another thread, and I'm trying to figure out how to build the SWIG stuff myself so that I can trace into Ogre C++ and figure out what's going wrong.

Last, the TerrainSceneManager doesn't seem to want to generate normals for my heightfield, even when turning it on in the terrain script and in the material for terrain. Another thing that C++ tracing is likely to find.
User avatar
Lee04
Minaton
Posts: 945
Joined: Mon Jul 05, 2004 4:06 pm
Location: Sweden
x 1

CEGUI?

Post by Lee04 »

Hi

What time frame is CEGUI on for Ogre pyton?

/Lee04
tentons
Gnoblar
Posts: 7
Joined: Sun Jul 13, 2003 4:47 am

Post by tentons »

You should try Eclipse and pyDev, which supplies lots of debugging options and many other nice features.
Locked