Cool VL Viewer forum http://sldev.free.fr/forum/ |
|
Lua scripting related requests http://sldev.free.fr/forum/viewtopic.php?f=9&t=1737 |
Page 6 of 10 |
Author: | ZaneZimer [ 2017-04-17 17:25:25 ] |
Post subject: | Re: Lua scripting related requests |
It seems to be related to using CallbackAfter() more than one time in my script for different callback functions. Which ever one is executed first is the one that will continue to work for future calls. Any CallbackAfter() set after the first one, doesn't seem to fire. |
Author: | Henri Beauchamp [ 2017-04-17 17:33:40 ] | |||||||||
Post subject: | Re: Lua scripting related requests | |||||||||
|
Author: | ZaneZimer [ 2017-04-17 17:46:25 ] | ||||||||||||||||||
Post subject: | Re: Lua scripting related requests | ||||||||||||||||||
|
Author: | Henri Beauchamp [ 2017-04-17 19:08:38 ] |
Post subject: | Re: Lua scripting related requests |
Yes, this is very weird, because my code does properly store each callback in a different slot of the LUA_REGISTRYINDEX table, and does pass the corresponding (Lua-engine-allocated) reference to the callback. With debug messages on, I can see both callbacks properly queued with different references, and then called with the corresponding references. It's like if Lua was returning the first callback data (function + parameters) for *both* references... I'll investigate further but to me, it looks like a Lua bug ! |
Author: | Henri Beauchamp [ 2017-04-17 21:58:07 ] |
Post subject: | Re: Lua scripting related requests |
I found the bug: my code missed a lua_pop() in HBViewerAutomation::doAfterIntervalCallback(). In fact, as is, it should never have worked at all (because on lua_pcall() the first stack element is a number instead of the function "pointer", which only appears as the second element on stack), but apparently, a bug in Lua makes it more or less work (but only calling the first function)... Fixed for next release. |
Author: | ZaneZimer [ 2017-04-17 22:09:26 ] | |||||||||
Post subject: | Re: Lua scripting related requests | |||||||||
|
Author: | Henri Beauchamp [ 2017-04-29 09:35:13 ] | |||||||||
Post subject: | Re: Lua scripting related requests | |||||||||
|
Author: | ZaneZimer [ 2017-04-30 13:38:10 ] | ||||||||||||||||||
Post subject: | Re: Lua scripting related requests | ||||||||||||||||||
|
Author: | ZaneZimer [ 2017-04-30 23:59:27 ] |
Post subject: | Re: Lua scripting related requests |
As I was working on my Lua automation today, a couple of ideas for enhancements occurred to me:
|
Author: | Henri Beauchamp [ 2017-05-04 09:07:20 ] | |||||||||
Post subject: | Re: Lua scripting related requests | |||||||||
Please note that viewer-side Lua scripting is not meant to replace server-side LSL scripting (especially since you can have LSL scripts invoking Lua commands, bringing a whole new lot of possibilities for your scripts). So, I'm not going to reimplement on the viewer side all what already exists on server side with LSL... However, I implemented the following for next release:
|
Page 6 of 10 | All times are UTC |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |