pix
31-08-2006 14:41:05
hey there,
regarding swig and python, i am still relatively noobish, so i apologise that this idea might be fundamentally flawed. i'm just trying to work out whether this is a sensible idea, before diving in.
so, i'd like to create some extra classes in c++ that return ogre types. for example, a factory that returns some custom renderable. i'd like to store these classes in my own lib (rather than hacking them directly into ogre) so that i can continue to track new releases of ogre with minimal fuss.
my question is, if i do this, how would i go about making a python interface to my library so that it can return types defined in the ogre library (like a subclass of Ogre::SimpleRenderable)?
i'm assuming it would work if i just made my own additions to pyogre that supported my library objects, but is there a way to do it such that my library is it's own python module? i'm not sure if in python, you can have a proxy object that is from one module (a proxy of Ogre::SimpleRenderable created by my library), and then hand it to a method in another module (SceneNode::attachObject() in pyogre), even if it is a proxy for the same kind of object on the c++ side?
any swig gurus have any hints?
pix.
regarding swig and python, i am still relatively noobish, so i apologise that this idea might be fundamentally flawed. i'm just trying to work out whether this is a sensible idea, before diving in.
so, i'd like to create some extra classes in c++ that return ogre types. for example, a factory that returns some custom renderable. i'd like to store these classes in my own lib (rather than hacking them directly into ogre) so that i can continue to track new releases of ogre with minimal fuss.
my question is, if i do this, how would i go about making a python interface to my library so that it can return types defined in the ogre library (like a subclass of Ogre::SimpleRenderable)?
i'm assuming it would work if i just made my own additions to pyogre that supported my library objects, but is there a way to do it such that my library is it's own python module? i'm not sure if in python, you can have a proxy object that is from one module (a proxy of Ogre::SimpleRenderable created by my library), and then hand it to a method in another module (SceneNode::attachObject() in pyogre), even if it is a proxy for the same kind of object on the c++ side?
any swig gurus have any hints?
pix.