Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Cannot import any resource from any folder other than res:// #17848
OS/device including version:
I've tried importing files with various methods (see the example project for three methods for importing texture files). I've tried importing
According to the docs, the host file system can be used, but I've had no luck.
(Not sure if this is needed, but I'll explain anyway)
Steps to reproduce:
Minimal reproduction project:
I looked at that, but even in
I just tried with the example project, and it doesn't load images from
Kinda off topic, but...
Is there a way to load meshes like in the issue linked above? I looked but I didn't see anything for loading meshes from code.
Well, I found a interesting way around the problem, it is just a bit more involved.
All it requires is placing the image in a Godot project, and then saving it out using
I can provide a test project if you guys want. I think you can use the same method to save almost any resource in Godot. I've tried saving meshes this way, but I haven't quite figured out how to do it.
This is probably more trouble than it's worth, but for anyone looking for a way to load files from anywhere in the file system, this method seems to work nicely.
I know this is totally off topic from this issue, and I promise this is the last off-topic post I'll make on this issue. I just wanted to share an update for anyone trying to load files outside a project, as I found it interesting and it may help others with similar interests/problems
Since I last posted, I figured out how to save and load meshes. Turns out it works almost exactly the same as saving images. You just need to use
So, after figuring this out, I decided to take a small detour and see if I can save/load entire scenes using the
You can save ANY node to a file using
All of the properties from the node will be saved, with only resources being lost on export. You can get around this by saving the resources as well (like
One interesting thing to note is that nodes will forget their name when they are stored using
Another interesting problem to work around is rebuilding the scene tree. I found a way around this by storing a JSON dictionary with the names of the children for each node in the scene. Then it is just a matter rebuilding the node tree using the JSON dictionary and a depth-first algorithm.
So after a few days of tinkering, I have successfully made a editor plugin that saves and loads
Right now the plugin only has resource support for
In theory I should be able to support most, if not all, of the default nodes Godot provides, as only a few nodes need custom resource support.
The one big downside with
A minor downside is that in order to make a
So if anyone is looking to load scene files from anywhere in the file system, I have a plugin that (hopefully) will do exactly that. Right now the code messy, poorly documented, and there are still a lot of nodes missing resource support. I do not really know when I will be able to release it, but I'm hoping for sooner rather than later.
Right now I am struggling to get scripts from nodes in the open scene in the editor. It seems