Hi,
I have tried using the helper functions used in the PluginSkeleton and other plugin examples but they do not seem to have a method that supports returning something like std::vector<std::vector<float> >, a vector of vectors.
What would be the best way to return a vector of vectors from a c++ plugin to a Lua script?
Thanks,
Rodrigo
Returning a Matrix from a plugin
Re: Returning a Matrix from a plugin
Hello Rodrigo,
you can do this if you use the stack functions. The plugin skeleton project also illustrates a callback function that uses the stack functions: LUA_GETDATA_CALLBACK
In pseudo code, you would do something like:
you can do this if you use the stack functions. The plugin skeleton project also illustrates a callback function that uses the stack functions: LUA_GETDATA_CALLBACK
In pseudo code, you would do something like:
- simPushTableOntoStack(stackId)
- for i=1,arrayCnt do
- simPuckInt32OntoStack(stackId,i)
- simPushFloatTableOntoStack(stackId,array,count)
- simInsertDataIntoStackTable(stackId)
- end.