Open GoogleCodeExporter opened 9 years ago
Oh, and I'm using Windows XP SP2
Original comment by birnt...@in.tum.de
on 7 Sep 2008 at 11:33
Hi, which osg version are you using ?
Could you perhaps post a complete file as an attachment so I can quickly have a
look
at it?
cheers,
Gerwin
Original comment by gerwinde...@gmail.com
on 14 Oct 2008 at 12:11
I haven't tried this myself, but often I encounter problems with reference
counting
and python garbage collection.
One should be aware that the reference counting of python objects and that of
the OSG
Referenced counterparts (e.g. Node, Array etc.) is linked. If a python object
goes
out of scope (e.g. the end of a function is reached), the osg reference counter
of
this object goes down. If this reference counter reaches zero, the node is
deleted.
If this node is attached somewhere in the scene, reference counting should not
reach
zero and all should be well.
In this example, I'm not sure if the self.canvas.viewer.setSceneData(node)
correctly
updates the reference count. To be sure, you might want to create a top-level
node
and set this to the scene, and addChild the node in your function under this
node.
Alternatively, you could keep a reference to the node in your python class (e.g.
self._node = node)
Original comment by gerwinde...@gmail.com
on 15 Oct 2008 at 12:44
Original issue reported on code.google.com by
birnt...@in.tum.de
on 7 Sep 2008 at 10:31