Provide a way for Editor Import Plugins to save images as compressed textures (.ctex) #11042
viniciusgerevini
started this conversation in
General Discussions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
It would be great to have a way for Editor Import Plugins to save images as compressed textures (.ctex)
The same way there is an
Image.save_png(path)
, is there a way to expose the method to save a compressed texture programmatically? This way import plugins could save textures directly to the.godot
folder instead of relying on texture importers to kick in for the new files generated.Use-case
I maintain Aseprite Wizard, which helps users to import animations from Aseprite to Godot in a few different ways.
Besides some manual import strategies, it also adds a few custom importers to use .aseprite files as SpriteFrames or texture resources.
To illustrate, here is how the custom importer for SpriteFrames works at the moment:
append_import_external_resource
to trigger the png import, otherwise schedule a scan for after all imports so the cache is updated.Throughout the years I've tried a few different approaches to deal with the externally generated png, but this has been the most reliable / consistent so far. However, I don't think it provides a good user experience.
The main issue is not being able to store these generated files inside
.godot
, as this would not trigger the built-in importer. This means that the generated spritesheet is visible to the user, and unless there is a file pattern they ignored, they end including them in the source control.Also, triggering a scan just after the import (to update the cache) can be jarring.
For now, in my plugin, imports only generate one spritesheet, but there are feature requests to break the spritesheet's further to workaround the texture 16384px size limitation. This would make the import process quite noisy as all generated pngs would have to be visible to the user.
I don't know anything about Godot internals. Does this make sense? Is there another workaround I'm missing?
Beta Was this translation helpful? Give feedback.
All reactions