This site is currently in read-only mode during migration to a new platform.
You cannot post questions, answers or comments, as they would be lost during the migration otherwise.
0 votes

Hey folks, I'm having a particular issue... I searched a lot on the internet and what I'm trying to do is quite simple actually, but I can't find anything to make it work!

So, I want the user to be able to pick a PNG file from a FileDialog window (using file system) and then, my code would copy it in the resource folder (with dir.copy(source, dest)). Everything work fine for this part, but I can't manage to use this very PNG file freshly imported.

BTW, I noticed that no .import file gets generated while copying the file in the resource folder from code (which really seems to be the problem). If I come back to the editor, the .import file is automatically generated and now, it works.

Is there a way to force a "scan" in the res folder while running? Or force generate a .import file?

Anyway... Any twist or turn around? I'm surely doing it the wrong way... Any advice is welcome! :)

Here's a piece of code :

var dir = Directory.new()
dir.copy(source, dest)
#This works!
get_node(txtr_image).texture = load(previs_image)
#This doesn't! No loader found error...

Thank you for your time!
Math

Godot version 3.5
in Engine by (46 points)

No one can help me? :(

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 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.