[osg-users] Object from LUA Script

Robert Osfield robert.osfield at gmail.com
Fri May 13 02:20:34 PDT 2016


Hi Matus,

The object passed back is a IntValueObject, see include/osg/ValueObject
header for its definition.

You can cast to this type and then access the Int.

Robert
On 12 May 2016 8:50 a.m., "Matus Gabriska" <matus.gabriska at gmail.com> wrote:

> Hi,
>
> I have problem with extracting value from osg::Object instance returned by
> LuaScriptEngine.
>
> Here is example of C++ code of running script:
>
> Code:
>
> osg::Parameters input;
> osg::Parameters output;
>
> input.push_back(transformNode);
>
> _luaScriptEngine->run(_script.get(), _entry, input, output);
>
>
>
>
> osg::Parameters is vector of osg::Object. After script is done, it
> populates
> output with osg::Object.
>
> This is LUA Script
>
> Code:
>
> function test(node)
> return 1254;
> end
>
>
>
>
> So in osg::Parameters output is now one osg::Object which contains integer
> value 1234. My question is how can i acces this value?Or somehow cast this
> osg::Object to integer.
>
> I think its stored in UserData because I printed some nodes in lua script
> and they contained UserData,so I tried object->getUserData() but then i
> stuck.
>
> Any ideas?
>
> Thank you.
>
> [/list]
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=67079#67079
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20160513/a5e4d95f/attachment-0003.htm>


More information about the osg-users mailing list