Skip to content

Support Godot 4.7 import pipeline#27

Open
endaye wants to merge 1 commit into
CodeAndWeb:mainfrom
endaye:codex/godot-4-7-support
Open

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

Conversation

@endaye

@endaye endaye commented Jun 19, 2026

Copy link
Copy Markdown

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

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.

1 participant