0 votes

Title mostly describes the issue; I'm writing a custom importer for Aseprite files, and I've already written the actual image generation code (takes the Aseprite file, parses and processes it, turning it into an Image), but I don't know how to make the EditorImportPlugin save the generated Image.

What I'm doing right now, is taking the generated Image, creating an ImageTexture from it using ImageTexture.create_from_image(an_image) and saving that in my custom EditorImportPlugin. It saves it with extension "tex" and returns "ImageTexture" from get_resource_type().

Unfortunately this doesn't seem to be the right way to go about it, as Godot doesn't handle the imported resource properly. If the Aseprite file is modified (automatic reimport), or you manually force a reimport, nothing happens. For Godot to recognize any changes, you have to fully quit the editor and start it back up.

Originally I wanted to attempt to import as a StreamTexture (as that what all other image types import as), but looking through the engine source, it isn't fully exposed to GDScript, so it's not possible to actually generate a new StreamTexture. All you can do is create a new instance that loads an existing one saved to disk.

Anyone that can chime in on the correct way to handle this importer, I'd appreciate it.

in Engine by (20 points)

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.