Hi, Robert 

I have success with small example on OSG version 3.3.3. I call lua function. 

function test (s)
        k = s.Name;
        print(k);
        s.Name="InScript";
        print(s.Name);
        no = new("osg::Group");
        no.Name = "Node2";
        s:addChild(no);
    return no;
end

as input parameters in code is 
osg::ref_ptr<osg::Group>inNode = new osg::Group;
                inNode->setName("Start");
                inputParameters.push_back(inNode);

outuput parameters 
osg::ref_ptr<osg::Group>outNode = new osg::Group;
                outputParameters.push_back(outNode);

and output :
Start
InScript
input node name = InScript
num children 1
 Child node name : Node2
output node name =

As you can see, output parameter node has not set new name from csript. Can you 
tell me where is the problem, or how to use output parameters ? 

And second example. 
lua code 

function test2(a)
        --print(a)
        return 0;
        end

input parameter 
inputParameters.push_back(new osg::Vec3fValueObject("vector",osg::Vec3f()));

output parameter 
osg::ref_ptr<osg::Vec3fValueObject> svo = new osg::Vec3fValueObject("return", 
osg::Vec3f());
                outputParameters.push_back(svo);
output 
Lua error : attempt to call a table value
script run failed

This simple example doesn't work. It work with base value objects as string or 
double but not with osg value objects as Matrixd. Can you please tell me where 
is the problem? Whatever I try, it still doesn't work.

This is very basic examples and I think it can help all people starting with 
scripting in OSG.

Thank you!

Cheers,
Martin

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=62726#62726





_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to