Hi Martin, I can't spot what might be wrong from your a simple review of your code, I think in principle it's roughly what you should be doing.
The only thing I can think of that might produce the warnings you are reporting would be if the serializer plugins aren't being loaded by the OSG for some reason - perhaps the library paths aren't set up on your system correctly. Try setting the env var OSG_NOTIFY_LEVEL to DEBUG and have a look at the output - this should contain the lists of plugins and paths that it's attempting to load. If this doesn't work and I have some time I'll see if I can build your code. Robert. On 19 February 2015 at 20:01, Martin Ferry <[email protected]> wrote: > Hi, Rober > > I have not added any object to outputParameters, and after script run I > have object in output parameters. So I understand it outputParameters. > > But I still have problem with value object as Vec3f or similar. > here is C++ code . > > int main( int argc, char **argv ) > { > > osg::ArgumentParser arguments(&argc,argv); > osgDB::getDataFilePathList().push_back( "D:/zbcmy/osg33/data/" ); > > osg::ref_ptr<osg::Script> script = > osgDB::readScriptFile("D:/zbcmy/vosg2/Debug/script/test.lua"); > if (script.valid()) > { > osg::Parameters inputParameters; > osg::Parameters outputParameters; > inputParameters.push_back(new osg::MatrixTransform); > inputParameters.push_back(new > osg::Vec3fValueObject("Vec3f",osg::Vec3f())); > osg::ref_ptr<osg::ScriptEngine> luaScriptEngine = > osgDB::readFile<osg::ScriptEngine>("ScriptEngine.lua"); > > if (luaScriptEngine->run(script.get(),"test", > inputParameters, outputParameters)) > OSG_NOTICE<<"Successfully ran script : return > value = "; > else > OSG_NOTICE<<"script run failed"<<std::endl; > } > _getch(); > } > > and lua code > > function test(a,k) > a.Name = "Pito"; > a.Matrix = new ("osg::Matrixf()"); > e = new ("osg::Vec3f"); > --a.Matrix.Trans() > return a; > end > > output > Lua error : attempt to call a table value > Function doesn't accept osg value object ? Something is wrong but I don't > know what is wrong. > > When I comment out line with Vec3fValueObject I get output > > ClassInterface::createObject(osg::Matrixf()), No object wrapper avaiable. > Failed to create object osg::Matrixf() > LuaScriptEngine::setPropertyFromStack(0060FF80, Matrix) property of type = > MATRIX not implemented > ClassInterface::createObject(osg::Vec3f), No object wrapper avaiable. > Failed to create object osg::Vec3f > > I think that creation Matrix or Vec3f in Lua code is wrong , but I don't > know how to do this. > > Many thanks that you spent your expensive time with my not clever posts > but I don't see any way for learn lua scripting in OSG. > > Cheers, > Martin > > ------------------ > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=62743#62743 > > > > > > _______________________________________________ > osg-users mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org >
_______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

