Scene resources can be saved externally by the editor, but the resource path is not saved in the editor

Godot Version

v4.2.1.stable.official [b09f793f5]

Question

In the Godot editor, I have a scene with a MeshInstance3D node, where the mesh is generated by a gdscript. By default, when the scene is saved, the mesh resource is saved in the scene.tscn file. Because this file has gotten huge, I would like to save this mesh as an external resource. In the editor, if I change the resource path to “res://my_resource_name.res” and save the scene, my scene.tscn file is smaller, and the file, my_resource_name.res is created, as expected.

If I close the editor and reload the game, the scene loads the external resource, as expected, but the resource_path shown in the editor is now blank. If I save the scene again, it saves the resource internally, and I am back where I started with a huge tscn file.

Is there a way to save the resource externally and have that path preserved in the editor when the scene is reloaded?

Thanks!

I would try removing the mesh resource in the node inspector. Save. Then load the external res mesh. And save again. I don’t think I have had an issue doing this, but I suspect you removed the resource and closed without saving. I would also say the editor can be funky sometimes.