Skip to main content

History: PyOgre run-time error FAQ

Source of version: 2 (current)

Copy to clipboard
            !!!!PyOgre common run-time error FAQ
{CODE(wrap="1", colors="python")} if techniquePass.hasVertexProgram() and
 techniquePass.getVertexProgram().isSkeletalAnimationIncluded():
 TypeError: No Python class registered for C++ class class Ogre::GpuProgramPtr
{CODE}
This is a PyOgre developement bug and should be reported to the development team (likely an old return_value policy that should not be there).

{CODE(wrap="1", colors="python")} ArgumentError: Python argument types in
      ControllerManager.createController(ControllerManager, 
 FrameTimeControllerValue, LightWibbler, WaveformControllerFunction)
 did not match C++ signature:
      createController(class Ogre::ControllerManager {lvalue}, class 
 Ogre::SharedPtr<class Ogre::ControllerValue<float> >, class 
 Ogre::SharedPtr<class Ogre::ControllerValue<float> >, class 
 Ogre::SharedPtr<class Ogre::ControllerFunction<float> >)
{CODE}
You likely forgot to call the base class constructor when subclass ogre class. You must always call base class constructo as follow:

{CODE(wrap="1", colors="python")} class LightWibbler(ogre.RealControllerValue):
     def __init__( self, light, billboard, minColour, maxColour, minSize, maxSize ):
         ogre.RealControllerValue.__init__( self )
         # your init-code here
{CODE}
When inheriting in Python, calling the constructor (__init__) of the superclass is more than just a good habit. :)