Questions about state of the scripting sytem #1180
|
I posted earlier (and even submitted a pull request that I later closed) about a new way to enumerate scripts to make it easier to add 'compiled in' scripts to the build. In submitting that, and seeing the failed tests, I dug in deeper and I learned a few things, and I have new questions that I hope someone can answer so I can apply myself to furthering scripting support. First of all... I should have approached my changes differently. That's fine. I'll redo them. I am brand new to this code base so I have a lot to learn. Second of all... It seems like maybe(?) the scripting support is only half done. I think. I am looking for guidance if I have this wrong. Here is the thing... I found this class called the ScriptManager. It seems like it wants to scan user specified (and a few standard) directories for scripts and track them in its registry. It seems like it might have been what I was looking for back when I started looking into this. But I can't find anyplace that calls... ... etc. So even though I see ScriptManager::getApplicationScriptsDir called when I create a script node, I don't see how that information is used, and I don't see how to get my own script, which I have place in the directory returned by that function call, can ever get instantiated. I just see that directory string used in bindings.cpp in a line of code like this... ... and I am left with a script node that I can right click on to see "factory presets" (those compiled in to the executable) but nothing like a "user preset" list that shows scripts I have in my script directory. What am I missing? I'd be happy to work on code to populate the context menu that appears when you right click on a script node, below the "Factory Presets" item where it currently just shows "(none)" if that is where work left off and no one is actively working on that... and if that is even the proper design. Thanks |
Replies: 2 comments 14 replies
|
That's a pretty good summary. The script manager is really just a place holder to deal with user scripts, when there's something tangible to work with. Right now all we really have is the Script node, and is more or less done. My original idea years ago, was to also incorporate Lua to "hook" in to things like "session loaded", "node added", etc so that users can react and do things at the model and app layer. Another big one would be to use Lua to actually modify and customize the Gui. This is where the script manager comes in, to keep track of user scripts installed on the system.... but I bit off more than I could chew and decided to leave the second half alone until I have the time and dedication to do it. |
|
Jumping in a the right moment I guess, since I was also looking into this thing. So, at the moment, only the "Factory Presets" scripts, hardcoded into Element, are available. New scripts requires building Element, right? Maybe this comment inside the |


Here ya go! 😎 #1183 . I'll merge it when the tests pass.