I use the ResourceSaver to save meshes as text for debugging when I suspect that meshes are not being imported correctly from the DCC. Upon investigation, it turns out that text resources (.tres) are now being saved as binary, even when explicitly telling ArrayMesh to NOT use compression on method add_surface_from_arrays (compress_flags = 0) and ResourceSaver's save method (flags = 0).
The thing is, it wasn't like this a few versions ago.
Saving a single vertex, such as Vector3(-1.0, 0.0, 1.0), would result in a .tres file with:
Converting to hex, that is clearly 0xbf800000, 0x00000000 and 0x3f800000, which are the hex-float IEEE 754 representations of -1.0, 0.0 and 1.0 respectively.
Text resources were supposed to be human-readable, and to a certain point they were. I even tried on 3.5-rc1, but the issue is still present.
Steps to reproduce
I've included a mrp below. Just extract it and run. It should create and save a buggy_mesh.tresArrayMesh text resource file on the project's root folder.
Upon investigation, it turns out that text resources (.tres) are now being saved as binary
Which Godot version was the first one to exhibit this new behavior? Please test Godot older stable releases like 3.3.4, then all 3.4 betas and RCs (you can find them here).
Godot version
3.4.4-stable
System information
Windows 10
Issue description
I use the
ResourceSaver
to save meshes as text for debugging when I suspect that meshes are not being imported correctly from the DCC. Upon investigation, it turns out that text resources (.tres
) are now being saved as binary, even when explicitly tellingArrayMesh
to NOT use compression on methodadd_surface_from_arrays
(compress_flags
= 0) andResourceSaver
'ssave
method (flags
= 0).The thing is, it wasn't like this a few versions ago.
Saving a single vertex, such as
Vector3(-1.0, 0.0, 1.0)
, would result in a.tres
file with:Now, it yields:
Converting to hex, that is clearly
0xbf800000
,0x00000000
and0x3f800000
, which are the hex-float IEEE 754 representations of -1.0, 0.0 and 1.0 respectively.Text resources were supposed to be human-readable, and to a certain point they were. I even tried on 3.5-rc1, but the issue is still present.
Steps to reproduce
I've included a mrp below. Just extract it and run. It should create and save a
buggy_mesh.tres
ArrayMesh
text resource file on the project's root folder.Minimal reproduction project
array_mesh_resource_saver_bug.zip