Hi All,
  I'm currently updating osgLua, hope this afternoon will be ready
and committed into the new subversion. Hope also Ole-Morten will help
me in the future :) so no more delays for everybody.

Cheers,
  Jose L.

2007/7/16, Emmanuel Roche <[EMAIL PROTECTED]>:
Well I tried this also (actually I couldn't load the lua plugin dynamically
so I try including all the sources in my program), but in the function
you're speaking about we have :

        if (lua_isuserdata(L, index))
        {
            Value *v = Value::get(L, index);
            if (v) return v->get();
            else
            {
                luaL_error(L,
                    "userdata can not be used as osgIntrospection::Value");
            }
        }


--> and according to me this "userdata can not be used as
osgIntrospection::Value" is not an easy "first solution" to skip that case,
it's really that the conversion is not possible right now (I wrote an other
thread on this point : how to convert a void pointer with only the class
name through osgintrospection...).

So, what i mean is: suppose you have a class binded to lua (with tolua++ for
example, so represented as specific userdata) like MyDrawable, derived from
osg::Drawable. Suppose you have loaded osgLua with "osg" wrapper, you cannot
do something like:

local g = osg.Geode()  -- This is OK: using osg wrapper, building "g" as a
"osg::Geode" introspection value
local d = MyDrawable:new() -- this is OK: using tolua to build a userdata
wrapping the C++ pointer

g:addDrawable(d)  -- ERROR : as an introspection Value, g expects other
introspection values as arguments for method calls... and, again, correct me
if I'm wrong, but there is no way to convert d (a void pointer + the name
"MyDrawable" as metadata somewhere) to an osgIntrospection::Value
dynamically... snif.

Manu.


2007/7/16, Ole-Morten Duesund <[EMAIL PROTECTED]>:
> Emmanuel Roche wrote:
> > There is still one major problem yet (at least for me) : you cannot mix
> > osg object built in lua with introspection and osg objects build in Lua
> > without introspection... and you can't even update osgLua to change this
> > : it is not possible to build and osgIntrospection::Value from a lu
> > userdata (void* !!!) as far as I know... :-(
>
> That's not really true. Admittedly I cheated, but.
>
> I included the osgLua/Value.h in my installation of osgLua. This gives
> me nice things like :
>
> osgIntrospection::Value osgLua::getValue(lua_State *L, int index)
>
> Undoubtedly there are better/more sensible ways to do it. But this works
> as well.
>
> - OM
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://openscenegraph.net/mailman/listinfo/osg-users
> http://www.openscenegraph.org/
>


_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/



--
 Jose L. Hidalgo ValiƱo (PpluX)
 ---- http://www.pplux.com ----
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to