Well, this approach solved it for me for ColourValue, Vector3 and a
few other classes, but I am now getting an error regarding an Enum:
File "CameraTrackingDemo.py", line 2, in ?
import Ogre as ogre
TypeError: No to_python (by-value) converter found for C++ type:
Ogre::HardwareBuffer::Usage
I first tried just setting:
ogre_ns.class_ ('HardwareBuffer').enumerations
('Usage').always_expose_using_scope = True
Then I tried:
ogre_ns.class_ ('HardwareBuffer').enumerations ('Usage').exclude()
Neither seem to work and I still get the error message.
The situation is as follows:
class Ogre::HardwareBuffer {
public:
enum Usage { ... };
};
HardwareBuffer is excluded for the time being until I get void *
wrapped appropriately, but there are other methods on other classes
that use Ogre::HardwareBuffer::Usage ...
I figure that excluding the HardwareBuffer class should also exclude
the HardwareBuffer::Usage enumeration. Regardless, I've tried
excluding it specifically, and still run into that problem ...
As a workaround, I plan on excluding each individual method that uses Usage ...
Lakin
On 5/31/06, Roman Yakovenko <rom...@gm...> wrote:
> On 5/30/06, Roman Yakovenko <rom...@gm...> wrote:
> > On 5/30/06, Lakin Wecker <lak...@gm...> wrote:
> > > I haven't tried your fix with SVN, I am going to do that right now.
> > > But I had just written this letter, so I'll send it to the list
> > > anyways. But stay tuned for an update on this situation as well.
> > >
> > > Now, I'm getting this error:
> > >
> > > TypeError: No to_python (by-value) converter found for C++ type: Ogre::Vector3
>
> Solved.
> Error description:
>
> struct Color{
> static const Color red;
> ...
> void do_smth( const Color& other = red );
> //The error was raised from the line that register this function,
> //because boost.python tries to create an python object from "red"
> //but Color class is not registered.
>
> }
>
> Solution
>
> mb = module_builder_t( ... )
> mb.class_( 'Color' ).always_expose_using_scope = True
>
> This will fix the problem. In future py++ will find this situation and
> will generate
> proper code.
>
> --
> Roman Yakovenko
> C++ Python language binding
> http://www.language-binding.net/
>
|