diff --git a/src/osgPlugins/lua/LuaScriptEngine.cpp b/src/osgPlugins/lua/LuaScriptEngine.cpp index 8e4edae51..f4c7196fa 100644 --- a/src/osgPlugins/lua/LuaScriptEngine.cpp +++ b/src/osgPlugins/lua/LuaScriptEngine.cpp @@ -25,7 +25,10 @@ using namespace lua; class LuaCallbackObject : public osg::CallbackObject { public: - LuaCallbackObject(const std::string& methodName, const LuaScriptEngine* lse, int ref):_lse(lse),_ref(ref) { setName(methodName); } + LuaCallbackObject(const std::string& methodName, const LuaScriptEngine* lse, int ref):_lse(lse),_ref(ref) + { + setName(methodName); + } virtual bool run(osg::Object* object, osg::Parameters& inputParameters, osg::Parameters& outputParameters) const { @@ -3271,6 +3274,15 @@ int LuaScriptEngine::setPropertyFromStack(osg::Object* object, const std::string OSG_NOTICE<<"Error: lua type '"<className()<<"::"< lco = new LuaCallbackObject(propertyName, this, ref); + osg::Object* value = lco.get(); + _ci.setProperty(object, propertyName, value); + + return 0; + } else if (lua_isnil(_lua, -1)) { OSG_NOTICE<<"Assigning property object (nil) to to object "<className()<<"::"<