Skip to content

Support Godot 4.7 import pipeline#27

Merged
CodeAndWeb merged 1 commit into
CodeAndWeb:mainfrom
endaye:codex/godot-4-7-support
Jun 23, 2026
Merged

Support Godot 4.7 import pipeline#27
CodeAndWeb merged 1 commit into
CodeAndWeb:mainfrom
endaye:codex/godot-4-7-support

Conversation

@endaye

@endaye endaye commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Summary

This updates the TexturePacker spritesheet importer for Godot 4.7 compatibility.

Changes:

  • Import sheet image dependencies with append_import_external_resource() before loading them.
  • Load imported textures with ResourceLoader.CACHE_MODE_REPLACE_DEEP.
  • Add a fallback return value to _get_preset_name() so the importer script compiles under Godot 4.7.
  • Guard recursive .tres cleanup against missing directories.

Why

In Godot 4.7, the custom .tpsheet importer can run before dependent image textures are imported and available through ResourceLoader.load(). Calling append_import_external_resource() during _import() lets Godot import and track those image dependencies before atlas resources are generated.

Godot 4.7 also reports _get_preset_name() as a parse error when not all code paths return a value.

Validation

Tested with Godot 4.7.stable.steam.5b4e0cb0f using a temporary project containing:

  • the plugin
  • a minimal PNG sheet
  • a minimal .tpsheet

Command:

godot4 --headless --editor --quit --path /private/tmp/tp-godot-47-test

@CodeAndWeb CodeAndWeb merged commit 693550b into CodeAndWeb:main Jun 23, 2026
@CodeAndWeb

Copy link
Copy Markdown
Owner

Thanks a lot for that fix!

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