Hi there,

i am a student and new opensg-user...

For our Project at the Bauhaus University Weimar, Germany
i am writing some wrapper classes for using OpenSG within Python.

So far i am using a OSG::Thread* called renderThread which does
the render stuff with glut. This works fine so that I can communicate
with the OpenSG main-thread from python to add new Nodes, etc. to the
SceneGraph.

My Question and Problem is:
How can i tell "my" renderThread that there is a new Node in the
Scenegraph which i created from Python. I have a method
in my wrapper "OSGPYNodePtr" which wrapps OSGNodePtr in the following
way (_value is OSG::NodePtr):

void
OSGPYNodePtr::addChild(OSGPYNodePtr value)
{
  beginEditCP(_value, Node::ChildrenFieldMask);
  {
    _value->addChild(value.theReal()); // value.theReal() is the real
NodePtr e.g. a tie created with SceneFileHandler
  }
  endEditCP  (_value, Node::ChildrenFieldMask);

  Thread::getCurrent()->getChangeList()->applyTo(1); // 1 is the
renderThread
  Thread::getCurrent()->getChangeList()->clearAll();

}

then i say in python:
tie = OSGPYSceneFileHandler_the.read("data/tie.wrl") # tie is an
instance of OSGPYNodePtr

anothernode.addChild(tie) # this invokes the wrapper code above.

it works but the tiefighter which appears in the window is only white
(texture is missing)

Whats wrong with my code above?

  Thread::getCurrent()->getChangeList()->applyTo(1); // "1" is the
renderThread
  Thread::getCurrent()->getChangeList()->clearAll();

is there a merge missing and how do use this merge call?


thanks for any help...

stephan





-------------------------------------------------------
This SF.Net email is sponsored by: SourceForge.net Broadband
Sign-up now for SourceForge Broadband and get the fastest
6.0/768 connection for only $19.95/mo for the first 3 months!
http://ads.osdn.com/?ad_id=2562&alloc_id=6184&op=click
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to