Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin support #288

Open
hellocatfood opened this issue Aug 15, 2022 · 8 comments
Open

Plugin support #288

hellocatfood opened this issue Aug 15, 2022 · 8 comments

Comments

@hellocatfood
Copy link

Please add support for people to write their own plugins for Goxel.

The benefit of this is that will allow people to write their own model format exporters e.g. #235

@guillaumechereau
Copy link
Owner

Yes this is something that I tried to do at some point (there is still a Lua and JS branch somewhere on GitHub). It would indeed be very nice, not just for exporters, but even maybe to implement new tools.

From my little tests I think the easiest would be to do it in js, and make all the core objects (layers, camera, etc) internally support being wrapped into js objects.

@pegvin
Copy link
Contributor

pegvin commented Aug 16, 2022

Look into https://github.com/svaarala/duktape, it's pretty good and small too, tho lua was more "easy" which i implemented but will add duktape in near future too.

@guillaumechereau
Copy link
Owner

There is already a 'ducktape' branch in GitHub that I did a long time ago to add scripting support. One issue was that it was too slow in my opinion. Goxel also used to have Lua scripting support a while ago. Since I didn't see much use for it I removed it, as I don't want to bloat the program with things that nobody uses. I think I also had a look at quickjs, though the code is not online.

@pegvin
Copy link
Contributor

pegvin commented Aug 16, 2022

Interesting, re-implement lua again then, it's simple and "fast"

@hendursaga
Copy link

I for one would like to see a Lua scripting API. Then I could use Fennel!

@guillaumechereau
Copy link
Owner

I am wondering what would the be pro and con of lua vs javascript as a plugin language. I feel like javascript is generally a better language, but lua is used a lot in video games.

@pegvin
Copy link
Contributor

pegvin commented Sep 8, 2022

lua is easy to implement, easy to learn even aseprite (a very famous pixel art editor) uses lua for plugin system, lite-xl is a text editor completely made in lua with some awesome plugins for it written in lua.

@guillaumechereau
Copy link
Owner

I started to work on javascript plugin support. In the last release (0.12.0) it is now possible to do some very basic scripts for goxel. I plan to add more bindings. I tried a bit to make it work with lua but in the end I found javascript easier to work with, since I am really not familiar with lua.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants