[C++-sig] Problems getting to grips with Boost v2.0
dave at boost-consulting.com
Tue Nov 5 22:48:25 CET 2002
Oliver Malham <oliver.malham at savageparsnip.com> writes:
> First off, let me congratulate everyone who has contributed to
> Boost.Python on producing such an excellent library. (And I'm sorry if
> this question is a bit long winded ;-)
> I'm currently working on a game engine that will use Python as the
> ingame scripting language that controls everything. A key part of this
> functionality is building the scenegraph for the current level. This
> takes the form of a tree of objects which are created by a factory
> object, and passed about as object pointers (the factory class manages
> the object's lifetime). Building a basic scenegraph in C++ works fine;
> however building the same scenegraph through the python interface
> doesn't seem to setup the scenegraph properly (the scenegraph object
> complains about being empty). I'm not sure where I've gone wrong, and
> would appreciate it if you could point me in the right direction.
Nice reproducible case!
> When this enters the game's main loop, I get messages from the
> constructors for the scene, scenegraph and bluescreen objects. From my
> debug messages it looks like the bluescreen object is being assigned to
> a different scenegraph object than the one constructed, which has me
> just a bit confused.
> Thanks for any advice you can give me, and I hope I'm not being stupid
> and wasting your time ;-)
It's clearly not stupid; you're having the same problem as Graeme has
Fortunately, your workaround is also basically the same:
It's obvious that you're not the only one who will have this problem,
so I'll bump the solution up in my priority queue.
dave at boost-consulting.com * http://www.boost-consulting.com
More information about the Cplusplus-sig