0 votes

I'm coding an importer for an exported file from an illustration and animation production software.

The exported file is a compressed (zip) file with the extension renamed. It contains files with descriptive data about the animation and nodes hierarchy and the images needed to reconstruct the asset.

I have been using gdUnzip to work the files in the compressed bundle, including extracting the image files to the project "res://(path)" folder.

After extracting the images, I cannot load the texture when I create the sprite because the Godot System does not seem to import resources within an import process. I need to switch application windows and return to Godot, so it imports the images, and then I need to reimport the file to get the resources (images) loaded as expected.

If I create an ImageTexture, loading the image from the disk, it works, but the scene/node/asset created is huge since the image data is saved in the imported file without compression.

Is there a way to import a known and native Godot resource, such as images, extracted in the middle of an importing process? How would one import an asset with several files and file types?

Godot version 3.5
in Engine by (18 points)

1 Answer

+1 vote

If I create an ImageTexture, loading the image from the disk, it works, but the scene/node/asset created is huge since the image data is saved in the imported file without compression.

Save the binary data to an external .res file instead of making it a built-in resource. Otherwise, the resource will be serialized as Base64 in the .tscn file, making saving/loading slower and resulting in a larger file.

by (12,717 points)
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 Frequently asked questions and 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 [email protected] with your username.