0 votes

I've recently learned how to use normal maps on 2D sprites (described here), and want to reuse this material on every sprite in the game, adjusting the shader parameter for the new sprite's differing normal map .png.

I tried to do this through scripting here but the approach seems overly complicated and won't work. How can I save the material through the editor (or an external program) and simply load it from the next sprite node?

in Engine by (670 points)
edited by

1 Answer

+1 vote
Best answer

@eons helped me find the save button in another Godot QA thread. Any Resource can be saved, which includes materials and shaders. At the top of the inspector are little save and load icons, which I had been missing and can be used to save them to disk and reuse throughout the project.

highlight save/load icons in inspector

by (670 points)
selected by

I use it a lot, also to manually edit the tres files to fix things like Curve2D nodes from Path2D which have no access from the editor and to quickly duplicate and modify similar animations copy-pasting.

Hey @eons, what do I do if the save button is grayed out? Not sure how it happened, but I cannot save any scenes right now.

enter image description here

I created a new scene for the resource and saved that instead. I went to Scene > Save Scene As, or just used Ctrl+S to save the scene. That works but may have some slight overhead/might be harder to edit the resource directly from xml.

That thing is for saving Resource type only, Nodes or built in types don't give that option.

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.