Skip to content

Commit 1a6676d

Browse files
committed
refresh filesystem view after importing sprite sheet
1 parent ab4b130 commit 1a6676d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

addons/codeandweb.texturepacker/texturepacker_import_spritesheet.gd

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,11 @@ func _import(source_file, save_path, options, r_platform_variants, r_gen_files):
8989

9090
create_atlas_textures(sheetFolder, sheet, image, r_gen_files)
9191

92+
# without this call Godot editor will not refresh its filesystem view
93+
EditorInterface.get_resource_filesystem().scan_sources();
94+
95+
# we have to save an empty resource in "save_path", otherwise an error is displayed,
96+
# and Godot will reimport the spritesheet each time the editor is re-entered
9297
return ResourceSaver.save(Resource.new(), "%s.%s" % [save_path, _get_save_extension()])
9398

9499

0 commit comments

Comments
 (0)