I have finally had some time to play around with this! My experience is that though even a lot of things are missing you can still do a quite a bit with some help from python.
The things that would enable me to do a lot more right now is (in order):
I would like to be able to get a āname idā of a selected embedded game object #2790. This would enable me to do a lot of things, because this would mean I could find the item in a text file and then do whatever I want with it.
Ability to query both open file and selection #2784. I was able to make a script that adds all selected images to an existing atlas that was also selected. It would be a nicer if I could add the images to the currently open atlas.
A way to get user input #2786, this would make it so that I can create files with names decided by the user. One of the scripts I made creates a āmonarch sceneā (collection, gui_script, and gui) but it requires that you have already made a gui scene, it would be nicer if I could popup a dialog asking for the name and then create all 3 items.
A not as important one is that directories should also be resources 2787. This would enable me to right click on a folder and ābatchā do things with it instead of having to open the folder and then selected everything in it.
I was able to do a lot of things with the help of python and DefTree: A python module for editing Defold files. I would totally recommend it when doing things like this (until we get something like it for lua), it was super quick to get a script that did fairly complex things up and running. Small disclaimer I made deftree.
If someone wants to see the different scripts they are in this repository
Create sound components based on right clicking wav or ogg files in the Assets view. You can select multiple and create them all at once based on the path and filename of each. It does the same as the standard .sound component field wise. Pure Lua so does not have any warnings.
Itās really powerful now that extensions/libraries can provide editor extension scripts to simplify setup of extension/library concepts or structures. I need to go through my libraries and see if thereās some workflows that could be simplified by also providing an editor script.
It would be useful if anyone with some free time and understanding of what editor scripts are currently capable of / likely to become capable of went through the issues https://github.com/defold/editor2-issues/issues and compiled a list of those which could probably be solved with editor scripts.
Instead of exposing a bunch of commands, you can expose a bunch of functions each returning a command, so users of your library can have their own get_commands calling into you.
If itās similar functionality that logically belongs, I think it should be in the same library.
If itās not, then they should probably be in separate libraries.
Having checkboxes for each and every script and command, does not seem very user friendly either imho.
Is there an IDE that does this today?
In my experience, if you compare with other IDEās that allow you to install packages (e.v Sublime, VSCode), they have two features we have yet to support: keyboard short cuts and nested menus.
Using these you can opt to put stuff under your package menu (e.g. āTools -> Packages -> MyScripts -> ā¦ā
Or, you could simply not register commands to any menu, but let the user bind commands to actual short cuts.
Are there any other ways that other IDEās have solved it?
Blender does. It also has built in search for assets of various kinds. Of course best experience is what we want so maybe some uber lists would be best so people subscribe to one opinionated list that they like, and general quality of life editor scripts are avoided being put into general purpose extensions.
Even though it requires a bit more work for maintaining and would make it a bit harder to find them it is probably better. Most users will probably not want all extensions anyway, so this would end up as the most clean way.
I mean, thereās ofc a sliding scale here, I think in this case I might be biased towards working with native code, whereas Iām not usually as strict when it comes to script code
We would love to be able to contribute directly to the editor too. I donāt mind getting better with Clojure (or whatever is necessary to work on it).
Notes: Does not work against github enterprice, requires python installed.
Print the status of your dependencies as an easy way to see if they are up to date or not. This one is written in python 2.7 therefore it should work on macOS out of the box (and with a python install on windows).
Example output:
Project 'defold-clipboard' is up to date.
Project 'defold-lfs' is out dated, latest version is
https://github.com/britzl/defold-lfs/archive/1.0.1.zip
Project 'extension-gps' is up to date.
Adds menu buttons under Edit for aligning gui nodes. Notes: This is in pure Lua! Can currently not get parent of a node, therefore it only works on nodes without parents. Only take Z rotation into account. Can currently not access pivot so it assumes all pivots are Center.
Adds menu buttons under Edit for distributing gui nodes. Notes: This is in pure Lua! Can currently not get parent of a node, therefore it only works on nodes without parents. Can currently not access pivot so it assumes all pivots are Center.