Python-Ogre 1.6.1 Update - April 2 w/ Python 2.6 support

andy

26-02-2009 02:37:50

UPDATE April 2 - r940 available -- changes below in italics

I've created an updated 1.6.1 binary that is designed to upgrade an existing 1.6.1 installation (ie it only contains the updated files)..

You can download it from [b]here[/b] for Python 2.5

Or [b]here[/b] for Python 2.6

Decompress it over an existing Python-Ogre 1.6.1 installation and run "python setup.py install" to refresh your modules...

Changes can be found in the changelog.txt and include:
* FIX: Bullet and ogreBullet Modules
* FIX: Pretty printing of Vectors etc fixed
* Fix: Exposed std::vector<bool> for joystick buttons in OIS
* Fix: DataStream Ptr's were broken - fixed issues with non const shared pointers being exposed

* Update: Caelum, OgreForests, OgreAL, Hydrax, ODE and Bullet all have updates to base C++ libraries
* Update: Using Boost 1.38

* Update: OgreMovableFactoryObect (specifically getType function) can now be sub classed
* Update: Bullet modules created around Bullet 2.73 now working properly and wrappers improved
* Update: ogre.LodDistanceList is now ogre.stdVectorFloat -- change in ET demo
* Update: QuickGUI Demo updated - works and shows more functionality
* Update: Canvas wrapper expanded to include helper functions and demo completed
* Update: FFmpeg wrapper is back
* Update: Updated dotsceneloader and added demo

* Change: Replace Theora module with ogrevideo
* Change: Exposing functions that return standard pointers (int *, float * etc) with ctype return_addressof functionality previously these had been excluded
* Change: Added RakNet Module
* Change: Added plsm2 module (demo not yet working).
* Change: name property now exposed on PhysX desc opjects which required a change in the demo

Please let me know if you have an issues with this update..

Andy

digimikeh

26-02-2009 14:02:45

Nice that uses python 2.5.4, going to check it... thanks

bharling

26-02-2009 18:51:06

Great news, thanks andy,

will download and do some thorough testing this evening

cheers!

Martins1

01-03-2009 15:48:49

Wow! Thanks a lot for RakNet!!!

afecelis

06-03-2009 03:08:58

Works great! Thanks for the dotscene example. :)

skorpio

09-03-2009 07:31:10

Hello,

It works pretty good. I have not encountered any backward compatibility problems.

I was playing with Demo_QuickGui01.py, and I found a bug with keyReleased(), it needs injectKeyUp

def keyReleased( self, arg ):
k = gui.KeyCode.values[arg.key]
self.mGUIManager.injectKeyUp( k )
return True

It would crash when I typed something in the text boxes.

Best regards,

Skorpio

andy

09-03-2009 08:38:04

Thanks for the QuickGUI fix..

Andy

bharling

04-04-2009 11:09:14

BRILLIANT!!

This is exactly what i needed! have been wrestling with the theora plugin for a recent project trying to get high performance video playback working, and you've kindly updated it, just in the nick of time

do you read my mind or something?!

EDIT:

Ah, doesn't seem to be working though :-(

C:\PythonOgre\pluginsC:\PythonOgre\plugins;C:\PHP5\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Common Files\Ulead Systems\MPEG;C:\Program Files\ATI Technologies\ATI.ACE\Core-Static;c:\python25;c:\python25\bin;c:\python25\scripts;C:\Program Files\Subversion\bin;C:\Program Files\AdVantage SDK\Bin;C:\Program Files\MySQL\MySQL Server 5.0\bin;C:\Program Files\TortoiseSVN\bin;c:\mingw32\bin;C:\Program Files\QuickTime\QTSystem\;C:\Program Files\Samsung\Samsung PC Studio 3\;C:\google_appengine\;;C:\PROGRA~1\COMMON~1\MUVEET~1\030625
Traceback (most recent call last):
File "C:\PythonOgre\demos\ogrevideo\demo_video.py", line 25, in <module>
import ogre.addons.ogrevideo as theora
ImportError: No module named ogrevideo


updated everything as normal, then tried a complete re-install as well but still no joy.

EDIT AGAIN:

Got it working, seems that the update doesn't copy the ogrevideo modules into the site-packages folder ( there is no updated setup.py in the latest package ), however performance seems to be severely degraded for some reason ( will test on another machine shortly ). Ogre seems to be running at 200+ fps, but the video playback is about 4-5 fps. highly strange...

Perhaps an issue with my PC? am running on a single core, whereas the stuff I was reading over at the ogrevideo forum indicates it makes use of multithreading to decode the video

bharling

06-04-2009 10:21:39

Sorry to bump, but tested on my work power machine and the performance issues remain with the ogrevideo plugin, has anyone else tried the new version yet?

its better on a dual-core system, but still nowhere near as fast as the previous theora plugin. Also tried doing straight YUV output and transcoding in a pixel shader, which works but is still really slow ( around 8fps at best ).

Would really appreciate any help on this, as the ogrevideo update is critical to the project I'm currently stuck with :)

If I find out anything more will be back!

andy

06-04-2009 11:42:43

Do you have a sample video that you can put up for me to use in testing ?? Drop me a PM with a link etc :)

Andy

bharling

06-04-2009 12:08:42

Hi andy,

its performing badly even with the konqi test video that comes in the package. Cant seem to coax more than 4fps out of it with any video ( the ones I need to use are 720p and do much worse than konqi ).

I downloaded and compiled the ogrevideo project a couple of hours ago and the samples ( openal, and player ) run fine even with my 720p sources, so I think it must be something to do with the python bindings unfortunately. Do the konqi / fedora clips run ok on your system? Here I'm running P4 dual core 2.13 ghz, with nvidia 8500GT. demo_video.py is running at around 230 fps, but the video playback is not more than about 5-7fps at best :(

I also tried replacing Plugin_TheoraVideoSystem.dll with the one I compiled this morning but it doesn't seem to make much difference.

thanks for any help!

andy

06-04-2009 15:06:49

Try it without the sound enabled as I see problems with it... Comment out the audioFactory stuff and see if it makes a difference..

Andy

bharling

06-04-2009 15:23:41

already tried it I'm afraid - its the same :( ( sorry should have mentioned that ).


could it be boost-related?

EDIT:

Heres an app I coded up to create the video manually without a material script in case something was up there, but its still essentially the same performance as the original demo, just in case its any help :)

import sys
sys.path.insert(0,'..')
import PythonOgreConfig
import ctypes
import os

if sys.platform == 'win32':
newpath = os.path.abspath(os.path.join ( os.path.abspath(os.path.dirname(__file__)), '../../plugins'))
print newpath
os.environ['PATH'] = newpath +';' + os.environ['PATH']
print os.environ['PATH']

import ogre.renderer.OGRE as ogre
import ogre.addons.ogrevideo as theora
import SampleFramework as sf
import sys

class MyVideoManager( theora.TheoraVideoManager ):
def __init__(self):
theora.TheoraVideoManager.__init__(self)


class VideoListener( sf.FrameListener ):
def __init__(self, rw, cam, clip):
sf.FrameListener.__init__(self, rw, cam )
self.clip = clip
#print dir(self.clip.getTimer())
#self.clip.getTimer().play()

def frameStarted( self, evt ):
#self.clip.blitFrameCheck(evt.timeSinceLastFrame)
#self.clip.getTimer().update( evt.timeSinceLastFrame )
#self.clip.decodeNextFrame()
#print self.clip.isPaused()
#self.clip.blitFrameCheck( evt.timeSinceLastFrame )
#self.clip.decodedAudioCheck()
td = self.clip.getTimePosition() / self.clip.getDuration()
print td
if td >= 1.0:
self.clip.pause()
return sf.FrameListener.frameStarted( self, evt )



class OgreVideoTest( sf.Application ):
def __init__(self):
sf.Application.__init__(self)


def _createScene( self ):
print dir(theora)
mat = ogre.MaterialManager.getSingleton().create("VideoMaterialTest", "General")
tunit = mat.getTechnique(0).getPass(0).createTextureUnitState()
#tunit.setDesiredFormat( ogre.PixelFormat.PF_R8G8B8 )
#tunit.setNumMipmaps( 2 )
#tunit.setTextureAnisotropy( 0 )
tunit.setTextureAddressingMode( ogre.TextureUnitState.TAM_CLAMP )
mat.getTechnique(0).getPass(0).setFragmentProgram( "TheoraVideoPlugin/yuv2rgb" )

mgr = theora.TheoraVideoManager.getSingleton()

#self.root.addFrameListener( mgr )

mgr.setInputName( "dante.ogv" )
mgr.createDefinedTexture( "VideoMaterialTest", "General")
clip = mgr.getVideoClipByName( "dante.ogv" )
#clip = theora.TheoraVideoClip( "VideoMaterialTest", 64 )
print dir( clip )



#clip.createDefinedTexture("dante.ogv", "VideoMaterialTest", "General", 0, 0, 0)
clip.setOutputMode( theora.TheoraOutputMode.TH_YUV )
#clip.load("dante.ogv", "General")
#clip.play()
#print dir( clip )

ov = ogre.OverlayManager.getSingleton()
overlay = ov.create("videoOverlay")
# Create a panel
panel = ov.createOverlayElement("Panel", "PanelName0")
panel.setMetricsMode(ogre.GMM_PIXELS)
panel.setPosition(0, 0)
panel.setDimensions(self.viewport.actualWidth, self.viewport.actualHeight)
panel.setMaterialName("VideoMaterialTest")
overlay.add2D(panel)
overlay.show()
self.clip = clip

def _createFrameListener( self ):
print "fl"
self.fl = VideoListener( self.renderWindow, self.camera, self.clip )
self.root.addFrameListener( self.fl )


if __name__=="__main__":
try:
app = OgreVideoTest()
app.go()
except ogre.OgreException, e:
print e

andy

07-04-2009 01:54:33

I've used your demo and it works great on my machine (as does the original demos !!) :(

Perhaps there is an issue with the updates so could you try a complete clean (delete the build directory and your python25/lib/site-packages/ogre) then redo the setup.py and see if that helps...

I'll test on a couple of other machines in case I've messed up a dll in the packaging...

Andy

bharling

07-04-2009 08:17:09

Hi Andy,

sure will do! I have tried it on 2 machines now, a P3 2.8ghz hyperthreaded with 1.5 mb ram ATI Radeon X1650 ( python2.54 ), and the one above with an NVIDIA 8500 GT ( 2.54 again ) and performance is better of course on the dual core, but still much slower than the old theora plugin. Really need to get this working, so I'll ruthlessly erase everything and see what happens! There's also a quad core uber gaming rig available at work so I'll try that today as well if i get a chance.

Thanks for your help once again :)

cheers,

bharling

07-04-2009 11:19:35

Ok, have deleted ogre from site-packages, and also the build folder, and re-installed. There is a slight increase in performance, but its still very slow, even with the konqi video. definitely not the original framerate.

Also tested on the uber gaming rig - Core2 Quad @ 2.83ghz 3.0 GB ATI HD 4800, and still getting a jerky playback :? :cry:
Though of course its better than the other two. Ogre reporting a framerate of about 2000 fps, but the video is running at about 12-15 fps!

Also I noticed on the latest install demo_video was complaining that it couldn't locate OpenAL32.dll, which the others didn't. The latest rig I tried is essentially brand new, only has python-ogre and Blender installed with python 2.54 again

I dunno whats going on!

cheers again for any ideas!

bharling

07-04-2009 11:23:52

Also, just noticed - the OgreAL demo fails now after installing the new package:

Traceback (most recent call last):
File "Demo_AL_01.py", line 6, in <module>
import ogre.sound.OgreAL as OgreAL
File "C:\Python25\lib\site-packages\ogre\sound\OgreAL\__init__.py", line 6, in
<module>
from _ogreal_ import *
RuntimeError: extension class wrapper for base class class Ogre::MovableObject h
as not been created yet


Sorry to bear so much bad news .. :)

I'll have to revert back to the previous release for the moment, as my project depends very much on both ogreal and theora.

andy

07-04-2009 14:47:56

Dropped you an email to you hotmail address so we can solve this quicker :)

Andy

stodge

17-04-2009 18:13:40

Installed 1.6.1, I copied the update over the installation and ran python setup.py install. The PLSM demo crashes:

13:21:40: Texture: nskingr.jpg: Loading 1 faces(PF_R8G8B8,512x512x1) with hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,512x512x1.
13:21:41: OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource terrain_texture.0.0.png in resource group PLSM2 or any other group. in ResourceGroupManager::openResource at ..\src\OgreResourceGroupManager.cpp (line 753)
13:21:41: Error loading texture terrain_texture.0.0.png. Texture layer will be blank. Loading the texture failed with the following exception: OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource terrain_texture.0.0.png in resource group PLSM2 or any other group. in ResourceGroupManager::openResource at ..\src\OgreResourceGroupManager.cpp (line 753)
13:21:41: OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource terrain.Light.0.0.png in resource group PLSM2 or any other group. in ResourceGroupManager::openResource at ..\src\OgreResourceGroupManager.cpp (line 753)
13:21:41: Error loading texture terrain.Light.0.0.png. Texture layer will be blank. Loading the texture failed with the following exception: OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource terrain.Light.0.0.png in resource group PLSM2 or any other group. in ResourceGroupManager::openResource at ..\src\OgreResourceGroupManager.cpp (line 753)
13:21:41: OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource terrain_texture.0.0.png in resource group PLSM2 or any other group. in ResourceGroupManager::openResource at ..\src\OgreResourceGroupManager.cpp (line 753)
13:21:41: Error loading texture terrain_texture.0.0.png. Texture layer will be blank. Loading the texture failed with the following exception: OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource terrain_texture.0.0.png in resource group PLSM2 or any other group. in ResourceGroupManager::openResource at ..\src\OgreResourceGroupManager.cpp (line 753)
13:21:41: Texture: Detail3.jpg: Loading 1 faces(PF_R8G8B8,512x512x1) with hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,512x512x1.
13:21:41: OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource terrain.Light.0.0.png in resource group PLSM2 or any other group. in ResourceGroupManager::openResource at ..\src\OgreResourceGroupManager.cpp (line 753)
13:21:41: Error loading texture terrain.Light.0.0.png. Texture layer will be blank. Loading the texture failed with the following exception: OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource terrain.Light.0.0.png in resource group PLSM2 or any other group. in ResourceGroupManager::openResource at ..\src\OgreResourceGroupManager.cpp (line 753)


Anyone else experience this?

stodge

22-04-2009 15:57:27

More info:
ZZZZZZZZZZZZZZZZZZZZZZZZZZ ['__class__', '__delattr__', '__dict__', '__doc__', '__format__', '__getattribute__', '__hash
__', '__init__', '__instance_size__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__',
'__sizeof__', '__str__', '__subclasshook__', '__weakref__', 'clearEventString', 'getEventString', 'hasEvent', 'pageDefo
rmed', 'pageHide', 'pageLoaded', 'pagePostunloaded', 'pagePreloaded', 'pageShow', 'pageUnloaded', 'terrainReady', 'tileD
eformed', 'tileHide', 'tileLoaded', 'tileShow', 'tileUnloaded']
XXXXXXXXXXXXXXXXXX Preloaded 0 0
Error loading texture terrain_texture.0.0.png. Texture layer will be blank. Loading the texture failed with the followin
g exception: OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource terrain_texture.0.0.png in resource group P
LSM2 or any other group. in ResourceGroupManager::openResource at ..\src\OgreResourceGroupManager.cpp (line 753)
Error loading texture terrain.Light.0.0.png. Texture layer will be blank. Loading the texture failed with the following
exception: OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource terrain.Light.0.0.png in resource group PLSM2
or any other group. in ResourceGroupManager::openResource at ..\src\OgreResourceGroupManager.cpp (line 753)
Error loading texture terrain_texture.0.0.png. Texture layer will be blank. Loading the texture failed with the followin
g exception: OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource terrain_texture.0.0.png in resource group P
LSM2 or any other group. in ResourceGroupManager::openResource at ..\src\OgreResourceGroupManager.cpp (line 753)
Texture: Detail3.jpg: Loading 1 faces(PF_R8G8B8,512x512x1) with 5 generated mipmaps from Image. Internal format is PF_X8
R8G8B8,512x512x1.
Error loading texture terrain.Light.0.0.png. Texture layer will be blank. Loading the texture failed with the following
exception: OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource terrain.Light.0.0.png in resource group PLSM2
or any other group. in ResourceGroupManager::openResource at ..\src\OgreResourceGroupManager.cpp (line 753)




Installed 1.6.1, I copied the update over the installation and ran python setup.py install. The PLSM demo crashes:

13:21:40: Texture: nskingr.jpg: Loading 1 faces(PF_R8G8B8,512x512x1) with hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,512x512x1.
13:21:41: OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource terrain_texture.0.0.png in resource group PLSM2 or any other group. in ResourceGroupManager::openResource at ..\src\OgreResourceGroupManager.cpp (line 753)
13:21:41: Error loading texture terrain_texture.0.0.png. Texture layer will be blank. Loading the texture failed with the following exception: OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource terrain_texture.0.0.png in resource group PLSM2 or any other group. in ResourceGroupManager::openResource at ..\src\OgreResourceGroupManager.cpp (line 753)
13:21:41: OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource terrain.Light.0.0.png in resource group PLSM2 or any other group. in ResourceGroupManager::openResource at ..\src\OgreResourceGroupManager.cpp (line 753)
13:21:41: Error loading texture terrain.Light.0.0.png. Texture layer will be blank. Loading the texture failed with the following exception: OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource terrain.Light.0.0.png in resource group PLSM2 or any other group. in ResourceGroupManager::openResource at ..\src\OgreResourceGroupManager.cpp (line 753)
13:21:41: OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource terrain_texture.0.0.png in resource group PLSM2 or any other group. in ResourceGroupManager::openResource at ..\src\OgreResourceGroupManager.cpp (line 753)
13:21:41: Error loading texture terrain_texture.0.0.png. Texture layer will be blank. Loading the texture failed with the following exception: OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource terrain_texture.0.0.png in resource group PLSM2 or any other group. in ResourceGroupManager::openResource at ..\src\OgreResourceGroupManager.cpp (line 753)
13:21:41: Texture: Detail3.jpg: Loading 1 faces(PF_R8G8B8,512x512x1) with hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,512x512x1.
13:21:41: OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource terrain.Light.0.0.png in resource group PLSM2 or any other group. in ResourceGroupManager::openResource at ..\src\OgreResourceGroupManager.cpp (line 753)
13:21:41: Error loading texture terrain.Light.0.0.png. Texture layer will be blank. Loading the texture failed with the following exception: OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource terrain.Light.0.0.png in resource group PLSM2 or any other group. in ResourceGroupManager::openResource at ..\src\OgreResourceGroupManager.cpp (line 753)


Anyone else experience this?

andy

22-04-2009 17:03:20

Yeap -- the PLSM module needs some work :)

Will look at it in the next release..

Andy

Shadow64

04-06-2009 14:42:00

Also, just noticed - the OgreAL demo fails now after installing the new package

Any progress on solving this one?

I noticed that it works the second time if you attempt to import OgreAL twice in a row:


C:\>python
Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import ogre.sound.OgreAL
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python25\lib\site-packages\ogre\sound\OgreAL\__init__.py", line 6, in <module>
from _ogreal_ import *
RuntimeError: extension class wrapper for base class class Ogre::MovableObject has not been created yet
>>> import ogre.sound.OgreAL
>>>


Which leads to this as a workaround:


try: import ogre.sound.OgreAL
except: pass
import ogre.sound.OgreAL


Kinda ugly, but I guess it'll do for now :-)

playa3000

05-06-2009 03:23:43

i feel pretty stupid because i just read the PyOgre wiki site is based on PyOgre 1.0, but PyOgre 1.6.1 and 1.6.0 both tell me that i need to run python setup.py, and it IS NOT there!

A link to a PyOgre 1.6.1 tutorial for installation etc. would be greatly appreciated.
please help!

jacmoe

05-06-2009 04:42:40

Python-Ogre replaces the PyOgre project
Read about Python-Ogre in this sticky post:
[b]Python-Ogre Information -- Start Here[/b]

machinimist

14-06-2009 16:10:53

is it possible to install the update for python 2.6 without installing the full release first? i don't want to install python 2.5...

saladin

18-06-2009 06:56:40

Hi all,

Great job to andy and the team for python-ogre. You guys made life so much easier for me!

I compiled and built python-ogre on my ubuntu jaunty 32 version. I compiled it against python2.5 and then overwrote the files with the new python 2.6 update. It worked perfectly.

Now I'm trying to do the same thing on my Ubuntu Jaunty 64 bit on my new computer. I had no error during the building process. When I run the python-ogre demos as well as my own program, all the initialisation, resource loading etc. seems to go well until it enters the main rendering loop. I'll only get a blank screen. What's more, it keeps draining memory like crazy till I have to ctrl+alt+f1. At first I thought I didn't compile the ogre libraries correctly, so I tried running ogre C++ demos. Strangely they seem to work fine.

Can someone tell me what could be the problem here?

Cheers.

dermont

18-06-2009 08:35:04

Your best bet would be to check on the python-ogre developers group. I think a number of people have been running into the same problem with 64bit build for some time now. Maybe you will find an answer there.

http://groups.google.com/group/python-o ... d5617629d0

saladin

18-06-2009 10:57:42

Exactly the same problem as I'm having. I'll poke around there.

If anyone has a solution please give me a yell!

Cheers.

andy

06-06-2011 01:53:11

Unfortunately don't have a 64bit machine to test with :(

Andy