Plugin API docs

Do we have the API scripting documentation (including command syntax) somewhere that's in a file, text or otherwise accessible form. I'd like to get that all into a document that can be machine read.
Tried various tools to extract the text etc from documentation, the javascript/html thing is making that really challenging
42 Replies
andybak
andybak•14mo ago
The docs repo is here: https://github.com/icosa-foundation/open-brush-docs The pages related to the plugin api docs are all in this directory: https://github.com/icosa-foundation/open-brush-docs/tree/51f5b9146a742a14ea7fd4b5fb924cc267fe9550/alternate-and-experimental-builds/runtime-scripting/plugin-api-scripting-reference The docs are all in markdown format - although there's a fair amount of html tables used so it reads more like a mix of markdown and html.
I'd like to get that all into a document that can be machine read.
What are you trying to do?
AncientWorlds
AncientWorldsOP•14mo ago
I want to feed it to chatGPT, see if that's useful to me.
I seem to remember seeing a github command library or something with the syntaxes or list of commands?
andybak
andybak•14mo ago
The doc are all generated automatically from the code itself:
[LuaDocsDescription("Hides all camera paths")]
[LuaDocsExample("CameraPath:HideAll()")]
public static void HideAll() => WidgetManager.m_Instance.CameraPathsVisible = false;
[LuaDocsDescription("Hides all camera paths")]
[LuaDocsExample("CameraPath:HideAll()")]
public static void HideAll() => WidgetManager.m_Instance.CameraPathsVisible = false;
There's too much of it.
AncientWorlds
AncientWorldsOP•14mo ago
How much is there?
I think most of it can be done with just something like a list of commands we have implemented and their syntax, along with a few example scripts.
In concise form.
andybak
andybak•14mo ago
the biggest gpt4 context is 32kb (and that's not generally available). The docs are 300kb - so you'd need to somehow make it 10x smaller more than that actually - you need to save some of your context length for the actual conversation itself! you'd probably be better off passing in the _autocomplete.lua that is essentially a very compact description of the api that and a few example scripts
AncientWorlds
AncientWorldsOP•14mo ago
I could put the documents in Claude, but that's more for just having one long document that I can do my own searches from using ctrl-f _autocomplete.lua I'm pretty sure that's what I was specifically looking for.
I'd probably make a shorter readable document with the examples as well where is it?
andybak
andybak•14mo ago
ugh. even _autocomplete.lua is 93kb Read the tutorial! seriously - the tutorial is only a few pages and anything gpt suggests will be useless unless you know the basics
AncientWorlds
AncientWorldsOP•14mo ago
I've read through it. I want structured documentation of the important parts though on one page, it will make things easier for me I think.
andybak
andybak•14mo ago
if you're asking where the autocomplete file is, then you haven't read the docs very carefully 😉
AncientWorlds
AncientWorldsOP•14mo ago
I read them last week. It's in the git somewhere or in our code, I'll go look for it I read them twice, it was at around 4 am though
AncientWorlds
AncientWorldsOP•14mo ago
And I've looked at a million things since then Read through and worked through are different things, lol
andybak
andybak•14mo ago
but anyway - the autocomplete itself is too long for GPT - even assuming you've got access to the 32k context window version
AncientWorlds
AncientWorldsOP•14mo ago
I can use something else or a plugin that can access a repo
andybak
andybak•14mo ago
(although characters is not the same as tokens so there's some leeway) if you get anywhere, let me know. I've been trying to think of a way to leverage GPT and the best I came up with was "pass it a couple of example scripts and keep my fingers crossed" This is what fine-tuning is really meant for - but that is a lot more complicated to set up. I suspect there's some code-completion specific LLMs that might be better at this than GPT4 and can be fine-tuned on a specific codebase or API There's a plugin called "Ask the Code" I've been meaning to play with
andybak
andybak•14mo ago
No description
AncientWorlds
AncientWorldsOP•14mo ago
Well that's it. Give it the example scripts and documentation of the code, or related code sections maybe. Possibly use separate instances to extract summary info. Ask the code is one I've been looking at, although it wants a lot of permissions... also looking at some others.
Since I'm going to be initially modifying scripts, I won't necessarily need something as comprehensive, but do need to get it pointed at the right places
andybak
andybak•14mo ago
although it wants a lot of permissions...
Clone the docs repo and grant it access to your account
AncientWorlds
AncientWorldsOP•14mo ago
Ok, that's good. I need to get a handle on github cloning etc anyhow.
I've got a guy who's really good at finding AI tools, plays with them a lot
andybak
andybak•14mo ago
GPT is pretty good at understanding the plugins without knowing the api. if all you want to do is tweak a script - paste it in and ask gpt questions about it if he finds a good code-aware LLM then let me know
AncientWorlds
AncientWorldsOP•14mo ago
Still need to know what we have that we can use, which is why I was looking for the autocomplete. Apparently someone figured out how to do a million token LLM, don't know the details, or what its good at, just started that convo and jumped over here because its the first thing that came into my head He gave me some links to some lua specific AI things on git, haven't had a chance to look at them yet. I think that's more for A1111 interfacing and similar.
andybak
andybak•14mo ago
lol. AskTheCode doesn't help. And when it doesn't know, it makes stuff up: https://chat.openai.com/share/722cb2db-4f2e-4e8c-8c7d-08b6167671de
ChatGPT
ChatGPT
andybak
andybak•14mo ago
it just straight up invented it's own Vector2 class because the docs for my Vector2 were too long it's version looked plausible - but it wasn't correct.
AncientWorlds
AncientWorldsOP•14mo ago
hahaah
andybak
andybak•14mo ago
this is classic GPT behaviour or classic LLM behaviour really it's fine if you're asking it about a topic where you know 80% of it and need some help filling in the gaps. But if you don't know enough to spot when it's lying, it can waste a lot of time
AncientWorlds
AncientWorldsOP•14mo ago
Ya, that's the problem with this stuff still. Does ok if it has manageable chunks to work with, and better with stuff at the beginning and end.
It does like good script examples and explicit instructions to only use commands from list X or whatever I found the autocomplete lua in one of my files, not sure which install it came from. Didnt' find it on github True, but it also forces me to work through problems and ask questions that increase my understanding a bit.
andybak
andybak•14mo ago
The page I linked you to above says this:
Autocomplete and Intellisense for Lua scripts
If you look in your Documents/Open Brush/Plugins folder there is a subfolder called LuaModules and in there are a few commonly used libraries, that will provide some useful features. However one file is different. It contains empty definitions for all available API methods and prop
AncientWorlds
AncientWorldsOP•14mo ago
Weird, I missed that a few times now. thanks. Not sure how, it's not even a long page
andybak
andybak•14mo ago
second paragraph
AncientWorlds
AncientWorldsOP•14mo ago
Ya first line. I missed that three times somehow. Probably processing the images on some level. Anyhow thanks. I think my eyes keep getting drawn to the numbers and images under it
andybak
andybak•14mo ago
yeah. i probably should work on the layout a bit.
AncientWorlds
AncientWorldsOP•14mo ago
Its' pretty good. I just wasn't reading carefully enough. Not sure that anyone else would have the issue.
I'll see (relatively soon) if I can consolidate the information from the markdown source into something that I can scan. It doesnt' need to be perfect for my purposes, just get me in the ballpark, and easy to look up details from
AncientWorlds
AncientWorldsOP•14mo ago
What I'm mostly looking for at the moment is something to simplify getting from here
No description
AncientWorlds
AncientWorldsOP•14mo ago
To here
andybak
andybak•14mo ago
do you mean "filling in the wireframe parts"? not sure i get what you're trying to do from those two visuals
AncientWorlds
AncientWorldsOP•14mo ago
Couple of aspects around that. I want to be able to draw parallel lines a certain way, and probably join them after the draw. When we get some form of hull topology I'd like to connect face to face without a bunch of extra adds as well. Not sure if that's possible yet Basically make the wireframes as workable pieces, so a draw tool would help with that. Also more precisision on the selector. Goal is to have hull output that's thick enough to extract cleanly as a model So that's the first thing i plan to look at, once I have a better idea of what will work in practice Things like limiting join to the same material color or somehting would be helpful, so I'm not accidentally picking up unintended parts
andybak
andybak•14mo ago
hmmmm. feels a bit like gravity sketch would be the sweet spot for this kind of thing? one of their demos is almost exactly this kind of modelling
AncientWorlds
AncientWorldsOP•14mo ago
Haha maybe, I haven't used it in a very long time. I'm not sure if they actually have volume, which is something I definitely want At any rate, I definitely want a brush that draws parallel strokes, at the minimum, so that's where I'll start
andybak
andybak•14mo ago
there's already a script that does that? ManyAlong - uses the symmetry widget to define the direction although - that's strokes. do you need straight lines?
AncientWorlds
AncientWorldsOP•14mo ago
Maybe. I want it precise and a set distance, since it's basically prepping for a join. Straight lines that are exact as possible are ideal For most hard surfacing things I want to do. A tool like many along with presets where I want them would be something I'd modify though, can see uses for curves and what not. Seems harder To make the wireframe I'm using the straight edge with hulls. Getting them to line up correctly is hard, even with snapping. If I can draw them at the same time would be generally a lot easier. Especially if they resolve at exactly the same length and are automatically parallel (some kind of hullbrush, don't think it was actually a hull per se, would have to look)
andybak
andybak•14mo ago
These are all really tough problems to solve. We're essentially in CAD territory here.
AncientWorlds
AncientWorldsOP•14mo ago
Ya. Well all I need in the first place is a script that draws a straight line, and one that is mirrored to it, or perpendicular to an axis based on draw direction or something. More complicated is the other direction, maybe a plane shaped tooltip to set the axis, not really sure?
For practical purposes it would probably work fine if it 1. drew a flat strip (in line mode) 2. Drew the line brush at the edges of the strip 3. Erased the strip 4. Joined the lines so the strip defines the axis and distance (end points) :: using grid snap while drawing the strip would give more precision, but that would be up to the user
Want results from more Discord servers?
Add your server