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.gabri...@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@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org >
_______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org