Adds a hotbar with buttons for each of your editor scripts so you can write scripts to speed up your Godot development. Scripts can specify custom UI so you can pass parameters.
While Godot has built-in EditorScript, they only run from the code editor which means you can't see the scene and can't run when using an external editor.
Install and enable the addon as usual.
Put your editor scripts in res://code/editor/ and make them extend
LaunchableScript
. See code/editor/layout_circle.gd and
code/editor/rename_selected.gd for examples.
You'll get a new "Script Launcher" button on the bottom toolbar that incldues buttons for all of your scripts:
Add res://code/editor/rename_copy_first.gd:
tool
extends LaunchableScript
static func run_script(ed: EditorInterface, ui_root: Control):
var selection := LaunchableScript.get_selection_or_children(ed)
var name_of_first = selection[0].name.rstrip(" 0123456789")
for item in selection:
item.name = name_of_first
Hit Refresh, and now you'll have a new button!
Some of the included scripts as demonstrations of what's possible:
Sometimes Godot won't recompile your code so you'll have to disable + enable the EditorScript-Launcher plugin or restart the editor.
MIT