Skip to content

tools: Add script to load+save all scenes that use some resource - #2707

Merged
manuq merged 1 commit into
mainfrom
wjt/tools-add-script-to-load-save-all-scenes-that-use-some-resource
Aug 13, 2026
Merged

tools: Add script to load+save all scenes that use some resource#2707
manuq merged 1 commit into
mainfrom
wjt/tools-add-script-to-load-save-all-scenes-that-use-some-resource

Conversation

@wjt

@wjt wjt commented Aug 13, 2026

Copy link
Copy Markdown
Member

This is useful when making some change across all instances of a
script/scene:

  1. Add migration code to the script that runs when the node is
    instantiated
  2. Run this script
  3. Remove the migration code
  4. Commit the result

As commented here you can do this by running a built-in tool that does
this to all scenes but this can be much more disruptive.

You can also do this in the editor by using View Owners..., selecting
all, opening all the scenes, then saving each one. You can't use "save
all scenes" unless you have marked each scene as unsaved; and
EditorInterface.mark_scene_as_unsaved() only operates on the foreground
tab (haven't actually checked what happens if you bulk-open scenes and
call this during the loading of each one); so doing this by hand
involves hitting Ctrl+S, Ctrl+Shift+W, repeatedly.

This is useful when making some change across all instances of a
script/scene:

1. Add migration code to the script that runs when the node is
   instantiated
2. Run this script
3. Remove the migration code
4. Commit the result

As commented here you can do this by running a built-in tool that does
this to *all* scenes but this can be much more disruptive.

You can also do this in the editor by using View Owners..., selecting
all, opening all the scenes, then saving each one. You can't use "save
all scenes" unless you have marked each scene as unsaved; and
EditorInterface.mark_scene_as_unsaved() only operates on the foreground
tab (haven't actually checked what happens if you bulk-open scenes and
call this during the loading of each one); so doing this by hand
involves hitting Ctrl+S, Ctrl+Shift+W, repeatedly.
@wjt
wjt requested a review from a team as a code owner August 13, 2026 19:11
@github-actions

Copy link
Copy Markdown

Play this branch at https://play.threadbare.game/branches/endlessm/wjt/tools-add-script-to-load-save-all-scenes-that-use-some-resource/.

(This launches the game from the start, not directly at the change(s) in this pull request.)

@manuq manuq left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes!

@manuq
manuq merged commit 7e8801a into main Aug 13, 2026
7 checks passed
@manuq
manuq deleted the wjt/tools-add-script-to-load-save-all-scenes-that-use-some-resource branch August 13, 2026 20:55
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

Successfully merging this pull request may close these issues.

2 participants