+1 vote

I'm wondering if there is an option that allows you to move a file in the file manager, and automatically update all the nodes that have a reference to it?

It seems just moving files in the file manager will break all connections to it, and you have to manually update all node properties that use it.

in Engine by (5,266 points)

1 Answer

+2 votes
Best answer

EDIT: If you use the FileBrowser dock to move files, the editor will attempt to update most references (Godot 2.1.4). I did this recently on a game and it worked, I just had to close open files in the script editor and change some scripts because they were referencing old paths.

Old answer:
I don't think there is. This is how Godot works. In theory it can be implemented, by fetching every file in the project, searching for places where the path is written and replace it. But it would only work if all format is text, if there are binary assets (.scn, .res, .msh...) they will have to be loaded first and checked for every reference, making the process more tricky. And even more, some assets may reference the asset with a full path, others with a relative path (including scripts!).
So... it's not built-in, it's doable, but not trivial. For now you have to use the dependency fix dialog, or write a plugin.

Edit: also, there might be a way to actually improve from the dependency fix dialog, which actually fectched the places for us.

by (29,046 points)
edited by

Thanks Zylann.

I was considering writing a script or plugin in the future to handle remapping some sprites, if I ended up needing to change how I organized my images and textures. Wanted to be sure I wasn't missing something, because it always seems like I'm discovering some little nook that has a useful feature, after I've assumed it didn't exist, and began making my own solution.

I'll also make a note of the dependency dialog as well, for when the time comes.

This sucks royally. I'm currently struggling with this problem too. I moved some assets to organize them better and now some of my scenes crash when played, despite them loading fine in the editor :P In the debugger it says that it cannot find the referred files, but the paths it reports seem to be fine, so I can't figure out what's wrong :P

I edited my answer, I moved files through the file browser dock, the editor will attempt to update paths if you do it in the editor.

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.