I am writing a small program to generate colored meshes that look like planets using 3d perlin noise. All of that is going great, but now I need to export those meshes/colors to file for reuse in a space based game that I am writing. I am running into problems with exporting the meshes/colors.
func _on_export_meshes_pressed():
for i in range(num_meshes):
var mesh = Global.gui_summary_sphere.get_summary_sphere_mesh_instance()
print("Mesh = " + str(mesh))
var filename = "mesh_" + str(i + 1) + ".tres"
var file_path = output_directory + "/" + filename
ResourceSaver.save(mesh, file_path)
var result = ResourceSaver.save(mesh, file_path)
print("Result = " + str(result))
When I run the code I don’t get errors as such, but it doesn’t work. The print statement outputs are as follows:
Mesh = SummaryNoiseSphere:<MeshInstance3D#48922363471>
result = 31
As far as I can tell error code 31 indicates ERR_INVALID_PARAMETER, but I don’t know what I’m doing wrong.