Skip material save on scene save


I got custom MeshInstance3D mesh where i do apply material on _ready (working as tool in editor too)

when saving the scene with this i would like it to skip applied material (to not save it)

Question reason:
Scene load much longer with no-needed saved material.

How to not save assigned material on scene save?

Using NOTIFICATION_EDITOR_PRE_SAVE and NOTIFICATION_EDITOR_POST_SAVE you can just temporarily remove the material binding so it is not saved, then rebind it so it stays set in the editor.


Didnt even know there are notifications since im new in Godot.

perfect answer, thank you a lot :slight_smile:

works very nice.

func _notification(n):
	match n:
			mesh.surface_set_material(0, null)
			mesh.surface_set_material(0, material)
1 Like