Lua scripting related requests
Author |
Message |
Henri Beauchamp
Joined: 2009-03-17 18:42:51 Posts: 5915
|
I found the problem (in HBLuaPieMenu::removeAllSlices(): I forgot the indices and as a result it clears the vectors instead of emptying their string). It will be fixed in next release. In the mean time, avoid reloading a Lua automation script... Note that it won't crash the viewer under Linux (the vectors staying apparently allocated), and that's why I didn't notice the bug sooner...
|
2017-04-09 20:57:35 |
|
 |
ZaneZimer
Joined: 2016-06-19 21:33:37 Posts: 384 Location: Columbus area, OH, USA
|
Cool. Glad you were able to isolate it from my crude description of the problem. For now, I'll just comment out my pie menu initialization. I was really only tinkering with them to see how they worked. I was having a hard time coming up with a 'real' use case for pie menu functions anyway. 
|
2017-04-09 21:29:18 |
|
 |
ZaneZimer
Joined: 2016-06-19 21:33:37 Posts: 384 Location: Columbus area, OH, USA
|
I was pondering a bit last night. Which occurs first, the LuaPieMenuSlice 'command' or the OnLuaPieMenu 'event'? Also, would it be beneficial to have the slice index passed in the 'data' coming to OnLuaPieMenu?
|
2017-04-10 13:31:18 |
|
 |
Henri Beauchamp
Joined: 2009-03-17 18:42:51 Posts: 5915
|
The command line (when not "nop") is executed first, then the event (if any) is called. That has already been added for next release (I thought about it as I was compiling v1.26.20.16 for release, so it was to late for it).
|
2017-04-10 14:36:05 |
|
 |
ZaneZimer
Joined: 2016-06-19 21:33:37 Posts: 384 Location: Columbus area, OH, USA
|
I figured the order was consistent and assumed that they were executed in that order. Thanks for confirming. Cool. I should have known that you would have thought of that.
|
2017-04-10 16:51:49 |
|
 |
ZaneZimer
Joined: 2016-06-19 21:33:37 Posts: 384 Location: Columbus area, OH, USA
|
Should ApplySkySettings() return true for the pseudo-setting names: "region", "sunrise", "noon", "sunset" and "midnight"? Right now the function call does change the setting but returns false, implying it didn't locate the name.
|
2017-04-11 22:38:54 |
|
 |
Henri Beauchamp
Joined: 2009-03-17 18:42:51 Posts: 5915
|
Yes, it should... Fixed for next release.
|
2017-04-11 23:45:15 |
|
 |
ZaneZimer
Joined: 2016-06-19 21:33:37 Posts: 384 Location: Columbus area, OH, USA
|
I have verified the ApplySkySettings() fix. Thanks for getting that in. I'm running into something I can't seem to track down. CallbackAfter() doesn't fire many times. I have a simple function like: My avatar sits properly but then never stands. I use CallbackAfter() in another function to callback to itself and it works fine. If I reload (stop and load) the automation script, the code above starts working. As a side, a reload menu option might be nice to stop and reload the automation script instead of popping the file picker dialog.
|
2017-04-17 16:13:26 |
|
 |
Henri Beauchamp
Joined: 2009-03-17 18:42:51 Posts: 5915
|
It depends where you put that piece of code... If it's in not inside a callback, it's obvious it will not be executed aside from on viewer startup (or on script reload), while the agent is not yet initialized, which will result in a "nop"...
|
2017-04-17 16:59:23 |
|
 |
ZaneZimer
Joined: 2016-06-19 21:33:37 Posts: 384 Location: Columbus area, OH, USA
|
Right. The code is in the OnSendChat() callback. I'm keying off of '/sit' as a 'command' to execute that block.
|
2017-04-17 17:12:13 |
|
|
Who is online |
Users browsing this forum: Bing [Bot] and 8 guests |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum
|
|