[osg-users] Object from LUA Script

Matus Gabriska matus.gabriska at gmail.com
Wed May 11 14:37:50 PDT 2016


I have problem with extracting value from osg::Object instance returned by LuaScriptEngine.

Here is example of C++ code of running script:


osg::Parameters input;
osg::Parameters output;


_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


function test(node)
return 1254;

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.


Read this topic online here:

More information about the osg-users mailing list