How to save a resource (material, shader, etc) for reuse?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By jarlowrey
:warning: Old Version Published before Godot 3 was released.

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?

:bust_in_silhouette: Reply From: jarlowrey

@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

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.

eons | 2017-04-20 23:36

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

jarlowrey | 2017-05-03 17:23

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.

jarlowrey | 2017-05-03 18:47

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

eons | 2017-05-03 21:34