+1 vote

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://godotengine.org/qa/47956/export-not-including-non-resource-files
https://godotengine.org/qa/2575/some-resource-files-are-not-exported
https://godotengine.org/qa/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.
(_ _;;)



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

Godot version 3.4.0 (stable)
in Engine by (13 points)

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

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.