Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

What is ScriptNode good for?

200 views
Skip to first unread message

MichaelK

unread,
Jul 14, 2011, 7:13:31 AM7/14/11
to OpenNI
Since the new version of OpenNI, the context has to be made this way
in C#.

context = Context.CreateFromXmlFile(StaticConfig.OPENNI_CONFIG_FILE,
out scriptNode);

My question is: What is ScriptNode good for? Now I only get a warning,
that the variable is assigned, but never used :( Are there any
advantages, except the vendor information etc?

MichaelK

unread,
Jul 14, 2011, 7:15:20 AM7/14/11
to OpenNI
When I try to use "scriptNode.Info.Description.Version", the Unity
Engine crashes...

Alon Neubach

unread,
Jul 14, 2011, 7:46:26 AM7/14/11
to openn...@googlegroups.com
Hi Michael,

Nodes in OpenNI have a reference count, and when that count reaches 0 they are destroyed. The purpose of the ScriptNode is to hold a reference to all objects created by the xml script. This means you have the choice of when you'd like to release your reference to those nodes by calling ScriptNode.Release() or letting its destructor do it for you.

- Alon

--
You received this message because you are subscribed to the Google Groups "OpenNI" group.
To post to this group, send email to openn...@googlegroups.com.
To unsubscribe from this group, send email to openni-dev+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/openni-dev?hl=en.

MichaelK

unread,
Jul 14, 2011, 7:59:50 AM7/14/11
to OpenNI
In C# the ScriptNode does not have an implementation for the Release-
function.
And when i try to access any property, the Unity Engine crashes.
So is there a way to prevent the warning, that the variable is never
used, to show?

Ziv Hendel

unread,
Jul 14, 2011, 11:57:51 AM7/14/11
to OpenNI
Hi Michael!

We are unable to reproduce this crash here..

Can you please give us as much details as you can?
(Like what platform / os / unity version etc... you are using)

Thanks,
Ziv.
Reply all
Reply to author
Forward
0 new messages