[osg-users] Changing another thread's node's StateSet's data

Robert Osfield robert.osfield at gmail.com
Mon Dec 5 00:44:10 PST 2016


Hi Fei,

I am not familiar with the WPF, CLR acronyms, are these Windows
specific topics?  It's generally best to define acronyms if they
aren't completely standard.

As for accessing nodes StateSet's, if you have access to the Node then
you have access to the Node's set/getStateSet() methods.  The OSG
doesn't internally mutex or lock the accessors in anyway.

Given this there must be something completely unrelated to the OSG
itself and somehow your doing something on top which is causing the
problems, I'm guessing that's WPF/CLR what ever they might be..  If so
then you might want to look at forums for WPF/CLR for an answer.

Robert.

On 5 December 2016 at 07:49, Fei Liu <1243153982 at qq.com> wrote:
> Hi,
>
> I have a project which is required WPF to show a 3d scene, so I create a CLR dll project and a C++ dll project which use OSG. All of them were created in VS2013 and my osg version is 3.4.0.
>
> One of the demands in my project is that users can change model's texture through WPF's button. I create a thread for OSG scene, and another thread for interaction. However, I found that when I want to read specific node's StateSet through WPF, the image object which in Texture2D points to NULL. And because of this, I can't modify node's StateSet directly. Also, I found that I can't copy the nodes' StateSet for reusing or deleting them. I can only  set node's StateSet with a new StateSet, but I have no idea in recovering the model's texture.
>
> So I want to ask how to change node's StateSet directly through WPF and CLR, or how to save completely StateSet's data to a global buffer which will be read by another thread.
>
> Thank you!
>
> Cheers,
> Fei
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=69594#69594
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org



More information about the osg-users mailing list