Issue with Exporting Non-Resource Files

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Spyest

I’m a bit new to Godot, so please excuse my ignorance if the solution is rather simple, but I’ve created a program where one of the features changes the texture of a Polygon2D node by pulling from an array of textures. This array is built by looping through a specific FileSystem folder and appending each *.png into the array variable.

FileSystem Folder: https://imgur.com/0wbXKtM
The FileSystem Folder Scheme

The TextureLoader Function: https://imgur.com/a/KQ1gNX8
The TextureLoaderCode

Calling the TextureLoader Function: https://imgur.com/a/EWyLeuJ
TextureLoader Function in ready()


When running this in the Editor, the texture array is created and works properly; however when exported, it looks like the program has trouble finding the folders because the texture array remains empty.

Print Statement of TextureArray in Editor after running TextureLoader: https://imgur.com/H5eZx3o
Editor Print Statement

Print Statement of TextureArray in Exported File after running TextureLoader: https://imgur.com/OXlHCDS
Exported Print Statement

I’ve looked into this issue and found other folks had a similar problem, solving it through explicitly calling the files/folders in the Resources tab on the Export Window. Yet I’ve tried calling the files (*.png), calling the directory (BilletController/*, res://BilletController/*, & user://BilletController/*), and tried copying the resource folder into the same folder with the *.exe & *.pck files; yet none worked.

My References:
https://forum.godotengine.org/47956/export-not-including-non-resource-files
https://forum.godotengine.org/2575/some-resource-files-are-not-exported
https://forum.godotengine.org/71057/cannot-iterate-non-resource-files-in-the-directory-the-build
https://godotforums.org/discussion/24633/including-non-resource-files-in-export
https://github.com/godotengine/godot/issues/17053


With all that being said…

…am I missing something? Through my research, I saw some mention of a ResourceLoader, would that play a part in this? Any advice would be appreciated.
(_ _;:wink:



EDIT:
On further inspection, I confirmed that the *.png files weren’t actually being exported and only the *.png.import files, even when I explicitly called the file type and the folder within the Export window:

Print Statement listing all files in the FileSystem Folder: https://imgur.com/bIcCZBN
enter image description here

Export Window with Non-Resource Call: https://imgur.com/wEazhGR
Export Window

Print Statement listing all the files in the FileSystem Folder: https://imgur.com/Yt316M2
Print Statement Exported List

Wouldn’t it be easier to put all images into one big sprite sheet and then using it as texture in a sprite node?

juppi | 2021-12-03 16:01