My tileset's textures all must be adjusted to have a specific texture offset. Instead of doing this manually, I wrote a script (see below), which I run on-demand in the editor using CTRL+SHIFT+X.
The tileset gets updated as expected but when I exit the editor and come back, everything is back to how it was before.
I see two possible solutions:
1. Save the modified tileset .tres back - how?
2. Don't load the tres from disk but somehow access exactly the tileset loaded in the editor and then just save it using CTRL+S how? :-)
# Helper script.
# Run in editor by pressing CTRL+SHIFT+X
# This script adjusts the texture offet of a tileset.
tool
extends EditorScript
# Called when the node enters the scene tree for the first time.
func _run():
var tileset: TileSet = load('res://tilesets/floor.tres')
var ids = tileset.get_tiles_ids()
for tileId in ids:
print("Processing tile ID %d" % tileId)
tileset.tile_set_texture_offset(tileId, Vector2(0, -384))