Python-Ogre: Looking for Bugs!!

andy

02-03-2007 08:52:50

All

To date there have been more than 130 downloads of the Python-Ogre 0.9 binary - with basically zero reported bugs !! :?

As much as I'd like to assume we got everything right I know that this simply isn't the case, and ask that if you have any problems to please report them (so they can be fixed) via one of the following methods:

  1. Create a new ticket here
    Or send an email to python-ogre-developers@googlegroups.com[/list:u]
    If you do have problems can you please test the code with both the GL and DirectX renderers incase is works with one and not the other (which would make it an Ogre issue, not a Python-Ogre one)

    Your assistance here is greatly appreciated...

    Thanks

    The (extended) Python-Ogre Development Team

saladin

16-03-2007 06:32:55

When running Demo_Scenes.py in demos\OgreOde. When I pressed F7 to test the ragdoll scene, the zombie is not walking. And when I left clicked to shoot at it I get the following error.

AttributeError: 'Ragdoll' object has no attribute 'pick'

Traceback (innermost last):

File "E:\Python-Ogre-0.9a-PY24\demos\ogreode\Demo_Scenes.py", line 1, in ?
# /*
File "E:\Python-Ogre-0.9a-PY24\demos\ogreode\Demo_Scenes.py", line 407, in ?
application.go()
File "C:\Python24\Lib\site-packages\Ogre\sf_OIS.py", line 55, in go
self.root.startRendering()
File "E:\Python-Ogre-0.9a-PY24\demos\ogreode\Demo_Scenes.py", line 60, in frameStarted
self._demo.frameStarted(evt, self.Keyboard, self.Mouse) #we pass the keyboard etc to the main app framelistener
File "E:\Python-Ogre-0.9a-PY24\demos\ogreode\Demo_Scenes.py", line 253, in frameStarted
self._test.frameEnded(evt.timeSinceLastFrame, Keyboard, Mouse)
File "E:\Python-Ogre-0.9a-PY24\demos\ogreode\SimpleScenes_Zombie_NoAny.py", line 220, in frameEnded
if (radgoll.pick(self.myOdeRay, hit_body, hit_point)):


I tried using the auto complete from pycrust to find a proper function and this is what it gives 'OgreOde.Ragdoll.pick_da916f34aa9234b3f48fdb8c620c1074'.

andy

16-03-2007 08:47:44

It's not so much a bug as an incomplete demo program :wink: - I actually meant to disable the F7 key but forgot..........

I'll add it to the Wiki notes..

Cheers

Andy

Tubez

16-03-2007 08:54:25

Hey there! i'm running all of the examples and logging here if i run into any issues. If you prefer them entered in your trackign system (I see you run Trac) let me know.


demos\ode\tutorial3:

After a while:

Traceback (most recent call last):
File "tutorial3.py", line 178, in <module>
explosion()
File "tutorial3.py", line 90, in explosion
p = vec3(b.getPosition())
NameError: global name 'vec3' is not defined


demos\ogre\demo_blank:

D:\Dev\Python-Ogre-0.9-PY25\demos\ogre>d:\dev\Python25\python.exe Demo_Blank.py
Path is: C:\Program Files\PHP\;C:\Program Files\Microsoft DirectX 9.0 SDK (Augus
t 2005)\Utilities\Bin\x86;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbe
m;C:\Program Files\ATI Technologies\ATI Control Panel;C:\Program Files\Intel\Wir
eless\Bin\;;C:\Program Files\Common Files\GTK\2.0\bin;C:\Program Files\QuickTime
\QTSystem\;C:\Program Files\Hummingbird\Connectivity\11.00\Accessories\;;C:\PROG
RA~1\ATT\Graphviz\bin;C:\Program Files\Common Files\Autodesk Shared\;D:\dev\back
burner\;C:\Program Files\ATI Technologies\ATI.ACE\;C:\Program Files\Nmap;;C:\PRO
GRA~1\COMMON~1\MUVEET~1\030625;d:\dev\Python25\lib\site-packages\Ogre
d:\dev\Python25\lib\site-packages\Ogre\__init__.py:7: RuntimeWarning: to-Python
converter for struct std::pair<class std::basic_string<char,struct std::char_tra
its<char>,class std::allocator<char> > const ,class std::basic_string<char,struc
t std::char_traits<char>,class std::allocator<char> > > already registered; seco
nd conversion method ignored.
from _ogre_ import *


demo_renderercreate

GLSL compiling: CrowdGLSL
Traceback (most recent call last):
File "Demo_RendererCreate.py", line 100, in <module>
app = ApplicationFramework()
File "Demo_RendererCreate.py", line 63, in __init__
ogre.ResourceGroupManager.getSingleton().initialiseAllResourceGroups()
RuntimeError: unidentifiable C++ exception
Exception exceptions.AttributeError: 'frameListener' in <bound method Applicatio
nFramework.__del__ of <__main__.ApplicationFramework object at 0x00B96790>> ignored


Shadows (press the shadow technique button a bunch of times)

### <Ogre._ogre_.TextureManager object at 0x0178CDF8>
Traceback (most recent call last):
File "Demo_Shadows_Org.py", line 555, in <module>
application.go()
File "d:\dev\Python25\Lib\site-packages\Ogre\sf_OIS.py", line 55, in go
self.root.startRendering()
File "Demo_Shadows_Org.py", line 345, in frameEnded
self.CheckKeyPressed(KC_O, 1, self.changeShadowTechnique)
File "Demo_Shadows_Org.py", line 335, in CheckKeyPressed
func()
File "Demo_Shadows_Org.py", line 313, in changeShadowTechnique
shadowTex = shadowTex.getByName(name="ogre/ShadowTexture0") ## returns a Non
e object
Boost.Python.ArgumentError: Python argument types in
ResourceManager.getByName(TextureManager)
did not match C++ signature:
getByName(class Ogre::ResourceManager {lvalue}, class std::basic_string<char
,struct std::char_traits<char>,class std::allocator<char> >)
Unregistering ResourceManager for type BspLevel
*-*-* OGRE Shutdown



OgreNewt\Demo08_Ragdoll.py:

Ragdoll does not take part in collisions, items just go straight through him.

saladin

17-03-2007 21:58:01

It's not so much a bug as an incomplete demo program :wink: - I actually meant to disable the F7 key but forgot..........

I'll add it to the Wiki notes..

Cheers

Andy


What is the state of ragdoll system? Is it loading the .ogreode alright? What needs to be done with it?

If some functions are yet to be wrapped with py++ then I'll just sit here and wait if it's about manually writing up some functions I maybe able to help.

deficite

18-03-2007 00:21:51

It's not really a bug, but I was just wondering if there was any way you could (I don't know who's in charge of the OgreNewt part of python-ogre) make it to where custom callbacks can be inside of classes without making a mess?

andy

18-03-2007 00:32:28

What is the state of ragdoll system? Is it loading the .ogreode alright? What needs to be done with it?

If some functions are yet to be wrapped with py++ then I'll just sit here and wait if it's about manually writing up some functions I maybe able to help.

As far as I know everything is wrapped (and working :wink: )

The demo errors mentioned are entirely due to me not finishing the demos and I'd be very grateful to take updates from the community and add these to the release.

The original OgreOde ragdoll demo made extensive use of the C++ 'tinyxml' library which I did NOT wrap as I assumed we could convert the demo to use Python XML handling. I got about 50% through converting the demo..

Cheers
Andy

andy

18-03-2007 00:38:42

It's not really a bug, but I was just wondering if there was any way you could (I don't know who's in charge of the OgreNewt part of python-ogre) make it to where custom callbacks can be inside of classes without making a mess?
Could you expand on this a little....

What is it about the current implementation that "makes it a mess" and how would you like to see it done instead?

Cheers
Andy

deficite

18-03-2007 17:27:53

No, no, no. That's not what I meant. Sorry. I wasn't saying it's a mess. I'm saying is there any way you could make it to where the custom callbacks could be inside of classes without turning what we have (which is not a mess) into a mess. I think it's really elegant right now, and you python-ogre people and Walaber have done an excellent job. It's not really anything major, I was just asking if this could be done (and it might already be able to be done, I don't know).

Shows the weakness of online communication. It's easy to type something that would be misunderstood (the English language sometimes lends itself to this as well). Sorry if I made you mad when you read that, because I did not mean that python-ogre is a mess at all. Quite the contrary.

saladin

18-03-2007 20:53:22

No, no, no. That's not what I meant. Sorry. I wasn't saying it's a mess. I'm saying is there any way you could make it to where the custom callbacks could be inside of classes without turning what we have (which is not a mess) into a mess. I think it's really elegant right now, and you python-ogre people and Walaber have done an excellent job. It's not really anything major, I was just asking if this could be done (and it might already be able to be done, I don't know).

Shows the weakness of online communication. It's easy to type something that would be misunderstood (the English language sometimes lends itself to this as well). Sorry if I made you mad when you read that, because I did not mean that python-ogre is a mess at all. Quite the contrary.


Did u mean to make custom callbacks part of your ogreNewt body objects? Strictly OO speaking it isn't sensible. Custom callbacks defines how objects reacts to things like force, transformation and collision.

They're more like independent 'rules'. For example the conveyorMatCallback, it tells u what happens when a box collides with a conveyor. They're not properties of one class or another. Class objects can change quite frequently while rules don't change as often. Moreover, one rule is likely to be shared among different classes. e.g. same rule applies when different ogreNewt.Body hits the conveyor belt.

saladin

18-03-2007 21:03:49



OgreNewt\Demo08_Ragdoll.py:

Ragdoll does not take part in collisions, items just go straight through him.


My ogreNewt Demo built from C++ source does the same so I assume it's not a python-ogre problem.

It makes sense how the ragdoll appears 'untouchable'. Because
in mode '1' of the demo, the body is controlled by ogre skeleton animation 'LOOP', you'll need a collision callback to tell the ragdoll to stop the animation and return control to physics. You can see how that's done by entering mode '2' manually. (Press '2' on your keyboard)

However it puzzles me how in mode '1' the bullets don't seem to bounce back when hitting the ragdoll. And how the debugger shows no collision bodies on the ragdoll. I'm trying to figure that out from the C++ code.

deficite

18-03-2007 22:59:04

No, no, no. That's not what I meant. Sorry. I wasn't saying it's a mess. I'm saying is there any way you could make it to where the custom callbacks could be inside of classes without turning what we have (which is not a mess) into a mess. I think it's really elegant right now, and you python-ogre people and Walaber have done an excellent job. It's not really anything major, I was just asking if this could be done (and it might already be able to be done, I don't know).

Shows the weakness of online communication. It's easy to type something that would be misunderstood (the English language sometimes lends itself to this as well). Sorry if I made you mad when you read that, because I did not mean that python-ogre is a mess at all. Quite the contrary.


Did u mean to make custom callbacks part of your ogreNewt body objects? Strictly OO speaking it isn't sensible. Custom callbacks defines how objects reacts to things like force, transformation and collision.

They're more like independent 'rules'. For example the conveyorMatCallback, it tells u what happens when a box collides with a conveyor. They're not properties of one class or another. Class objects can change quite frequently while rules don't change as often. Moreover, one rule is likely to be shared among different classes. e.g. same rule applies when different ogreNewt.Body hits the conveyor belt.

I understand how callbacks work. I've been programming for about 6 or 7 years now. Just nevermind.

saladin

19-03-2007 22:25:39

Hi, I was trying to fix the ogreNewt Demo08_ragdoll.py and I found the following problems:

1.Line 233 in ragdoll.py bonepos = self.Node._getFullTransform() * ogrebone._getDerivedPosition() is a multiplication between a 4X4 Matrix and a Ogre.Vector3. The result should be another Ogre.Vector3 transformed by the matrix. But somehow the result became a Vector4. I am able to fix it by adding node._getFullTransform().extract3X3Matrix(blah) but I'm sure it's not the behaviour you would want.

2. Line 301 in ragdoll.py: joint.setCallback( self, "_hingeCallback" ) doesn't work. Function 'OgreNewt::BasicJoints::Hinge.setCallback()' (in c++ src) helps set up a callback to manage the updating of a hinge joint. I can't seem to find an equivalent in the python version.

andy

20-03-2007 02:35:20

#1 - the multiplication issue maybe fixed in the SVN - we removed a couple of implicit conversions that were causing multiplication of Quat's, vectors etc to give unexpected return types... I'll need to check this case.

#2 - Indeed these callbacks are missing (BodyIterator, Universal, Slider and Hinge) and will be in the SVN over the next day or so, and in the next binary release...

Thanks for your work in testing Python-Ogre

Cheers

Andy

saladin

21-03-2007 01:18:43

1. I tried this statement x = ogre.Math.Abs(0.1). And result x is of type Ogre._ogre_.Radian.
Can you please check?

2. The following try-catch block from my project tells whether an entity has already been created. It worked with pyogre 1.1x. But doesn't seem to catch the exception now.

try:
#if it exists, get the entity and make it visible
entity = self.sceneManager.getEntity(entityName)
entity.visible = True

except ogre.Exception, e:


The error message is as follows:
RuntimeError: OGRE EXCEPTION(5:ItemIdentityException): Object named 'blah' does not exist. in SceneManager::getMovableObject at \Development\Ocvs\ogrenew\OgreMain\src\OgreSceneManager.cpp (line 5305)

Tubez

22-03-2007 15:48:05

The exception type is different. Now it seems to emit a vanilla RuntimeError.

This should be addressed as RuntimeErrors are a dime a dozen, but in the meantime you can just retarget your except clause and (if you feel the need) check the exception message.

roman.yakovenko

22-03-2007 19:41:18


2. The following try-catch block from my project tells whether an entity has already been created. It worked with pyogre 1.1x. But doesn't seem to catch the exception now.

try:
#if it exists, get the entity and make it visible
entity = self.sceneManager.getEntity(entityName)
entity.visible = True

except ogre.Exception, e:


The error message is as follows:
RuntimeError: OGRE EXCEPTION(5:ItemIdentityException): Object named 'blah' does not exist. in SceneManager::getMovableObject at \Development\Ocvs\ogrenew\OgreMain\src\OgreSceneManager.cpp (line 5305)


Python-Ogre converts OgreException to RuntimeError.

Boost.Python library lacks some functionality in this area. It is possible to work around this problem and I hope we will do this before Python-Ogre 1.0.

Meanwhile I think there are 2 possible solutions:
1. To "except" RuntimeError
2. To create and contribute some decorator, which will be used for all exposed member and free functions, and will convert RuntimeError to OgreException.

Tubez

22-03-2007 20:37:14

Is it really that easy with py++ to auto-decorate all created functions?

If so, that's bloody amazing :P

Tubez

23-03-2007 10:00:27

When pressing "2" in ogrenewt ragdoll demo:


Texture: spot_shadow_fade.png: Loading 1 faces(PF_R8G8B8,128x128x1) with 5 hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,128x128x1.
Traceback (most recent call last):
File "Demo08_Ragdoll.py", line 256, in <module>
application.go()
File "d:\dev\Python25\Lib\site-packages\Ogre\sf_OIS.py", line 55, in go
self.root.startRendering()
File "Demo08_Ragdoll.py", line 232, in frameStarted
self.Ragdoll = RagDoll( "../media/models/zombie_rag_hull.xml", self.World, self.RagNode )
File "D:\Dev\Python-Ogre-0.9-PY25\demos\OgreNewt\ragdoll.py", line 180, in __init__
self._addAllBones( None, bone )
File "D:\Dev\Python-Ogre-0.9-PY25\demos\OgreNewt\ragdoll.py", line 225, in _addAllBones
me = self._addBone( self.World, parent, dire, shape, size, mass, ogrebone )
File "D:\Dev\Python-Ogre-0.9-PY25\demos\OgreNewt\ragdoll.py", line 288, in _addBone
bone = RagDoll.RagBone( self, world, parent, ogrebone, self.Mesh, dire, shape, size, mass )
File "D:\Dev\Python-Ogre-0.9-PY25\demos\OgreNewt\ragdoll.py", line 47, in __init__
col = _makeConvexHull( world, mesh, size.x )
NameError: global name '_makeConvexHull' is not defined
Exception exceptions.AttributeError: "RagBone instance has no attribute 'Body'" in <bound method RagBone.__del__ of <ragdoll.RagBone instance at 0x019EAFD0>> ignored
Exception exceptions.AttributeError: "'list' object has no attribute 'size'" in <bound method RagDoll.__del__ of <ragdoll.RagDoll instance at 0x0189CC10>> ignored

saladin

24-03-2007 02:34:14


Meanwhile I think there are 2 possible solutions:
1. To "except" RuntimeError
2. To create and contribute some decorator, which will be used for all exposed member and free functions, and will convert RuntimeError to OgreException.


Thanks. Solution one (so dumb of me to have neglected) worked.

By the way, dunno if this is an error or not, in python-ogre now you can initialize a compositor by calling
Ogre.CompositorManager.getSingleton().addCompositor(...). However no error was generated when the .compositor file is missing from all resource groups.

roman.yakovenko

24-03-2007 19:05:25

By the way, dunno if this is an error or not, in python-ogre now you can initialize a compositor by calling
Ogre.CompositorManager.getSingleton().addCompositor(...). However no error was generated when the .compositor file is missing from all resource groups.


For bad or good Python-Ogre wraps pretty close Ogre library. I believe this is the issue with Ogre. I checked our sources and I don't see we change a behavior of the function.

squeakypants

07-04-2007 06:36:47

lookAt isn't working in sceneNodes.
AttributeError: 'Node' object has no attribute 'lookAt'
That's using 0.9 though.

andy

07-04-2007 14:48:18

lookAt isn't working in sceneNodes.
It has to be a SceneNode you are using, not a Node (which seems like you are based upon the error message)..

The following works (not usefully :) )

node1 = sm.rootSceneNode.createChildSceneNode("RobotNode")
node1.lookAt ( ogre.Vector3(0,0,0), ogre.Node.TransformSpace.TS_LOCAL )
node1.lookAt ( (0,0,0), ogre.Node.TransformSpace.TS_WORLD )


Cheers
Andy

squeakypants

07-04-2007 22:49:06

I'm using it in the frameListener. Is that a problem? It is a sceneNode...
EDIT: I figured it out. It was because I was using getChild which returns a node instead of a sceneNode. My bad :)

andy

08-04-2007 00:29:14

Perhaps you could post the code you are using to create the object and show the line where you are attempting the 'lookAt'...

From your error message Python-Ogre certainly thinks it's a Node, not a SceneNode so either there's a bug in Python-Ogre, or the way you are constructing the object is wrong...

Now if you are deriving it from a Node.getParent, getChild, createChild, or removeChild then it's a bug in Python-Ogre -- fixed in the 1.0 release (soon)
Cheers
Andy

bharling

08-04-2007 18:46:39

Just to say, I'm getting the same errors as Tubez is on the first page of this thread, with the same demos (rendercreate, shadows etc.). Looks identical as far as I can tell. I'm using the 0.9 release for Python 2.5

dermont

15-04-2007 17:11:45

There appears to be a discrepancy with assertions and operators on different platforms:

Linux - Revision 261

>>> import ogre.renderer.OGRE as ogre
>>> v=ogre.Vector3(2)
>>> v[3]
python2.4: /usr/local/include/OGRE/OgreVector3.h:102: Ogre::Real& Ogre::Vector3::operator[](size_t): Assertion `i < 3' failed.
Aborted


Windows PythonOgreRelease1.0RC1c.NoMedia.zip

>>> import ogre.renderer.OGRE as ogre
>>> v=ogre.Vector3(2)
>>> v[3]
9007199254740992.0
>>>

dermont

15-04-2007 18:51:45

Shouldn't Quaternion ToAxes(Vector3* akAxis) return either a tuple of Vector3 pointers or floats.

On Windows (linux causes glibc crash):

>>> import ogre.renderer.OGRE as ogre
>>> q=ogre.Quaternion()
>>> v=ogre.Vector3()
>>> q.ToAxes(v)
>>> print v[0],v[1],v[2],v[3],v[4],v[5],v[6],v[7],v[8]
1.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 1.0
>>> type(v)
<class 'ogre.renderer.OGRE._ogre_.Vector3'>
>>> v+=v
>>> print v[0],v[1],v[2],v[3],v[4],v[5],v[6],v[7],v[8]
2.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 1.0


You could of course call ToAxes (Vector3& xaxis, Vector3& yaxis, Vector3& zaxis).

andy

16-04-2007 05:06:32

v=ogre.Vector3(2) # same as Vector3(2,2,2)
v[3] # is invalid as there are only 3 indicies (0..2)
v[0],v[1],v[2] are all OK


So the compiled Linux code is actually correct where as (I suspect) the optimisation in MSVC means it's not bounds checking (which is bad and I'll look at)


I'll look at the q.ToAxes(v) as it probably needs a modifier.. Again printing v[>3] is invalid..

Cheers
Andy

andy

17-04-2007 11:10:51

I've fixed the ToAxes, ToRotationMatrix and ToAngleAxes for Quat's in the SVN (not yet tested) -- would be great if you could test them :)

The bounds issue in Matrix3 is due to the Windows version being built as a 'release' version and hence the "assert" for bounds checking is non existent. The Linux compile you did is either a debug version or at elaset it's left the assert code in the binary..

Possibly raises the issue of wehter I should enable assert code in the next Windows binary (and I will if it doesn't get huge :) )

Cheers
Andy

dermont

17-04-2007 14:26:43

Re the assert, I compiled release version (and strip --strip-debug).As you say obviously the the assert code is still there. Sorry about that (embarrased).

For the update to ToAxes, ToRotationMatrix and ToAngleAxes, I'm encountering some problems compiling. I'll move this across to the developers group.

BlindRat

21-04-2007 09:19:11

When I run any demos, I get error window :
"Program rise error
AppName: Pithon.exe Modver:5.1.2600.2180
AppVer: 0.0.0.0 offset: 00010f29
ModName: ntdll.dll "
I have Python 2.5, pyton-Ogre 1.0 RC2, Windows XP.
With pyOgre i have no problem.

What shell I do :?:

Sorry for my bad english.

andy

21-04-2007 09:34:45

Have you run them from the command line (in a dos box)?

Does the error occur before or after you select your graphics driver _ have you tried both dirextx and GL?

Cheers
Andy

BlindRat

23-04-2007 09:15:29

Yes, I have run them from command line.
The error occur after I select grafics driver.
I tried only OpenGL.

andy

23-04-2007 10:02:57

Can you try with the DirectX driver to see if there is any change..

thanks
Andy

Biggles

23-04-2007 22:09:30

EDIT: oops! seems issue had been adressed already!