I'm trying to understand how the Custom0, etc array are configured in an ArrayMesh.
Issue 1: So the default is for custom arrays to be PackedByteArrays. So even though its not what I want to do ultimately, I have it set up where I put the data into a List<byte>() and then pass it in using ToArray(). However, when I do that I get this runtime error when I call RegenNormalMaps:
NativeCalls.cs:51 @ void Godot.NativeCalls.godot_icall_0_3(nint, nint): Extracting Byte/Half formats is not supported
<C++ Error> Condition "p_arrays[RenderingServer::ARRAY_CUSTOM0 + i].get_type() == Variant::PACKED_BYTE_ARRAY" is true. Continuing.
<C++ Source> scene/resources/surface_tool.cpp:857 @ create_vertex_array_from_triangle_arrays()
If I use anything other than a List<byte>, I instead get a runtime error when I call AddSurfaceFromArrays.
Issue 2: How do I accomplish configuring the format of the Custom arrays? The documentation is obtuse and borderline meaningless without a simple code example. I mean, I get this much:
arrayMesh.AddSurfaceFromArrays(Mesh.PrimitiveType.Triangles,
surfaceArray,
null,
lodDictionary
Mesh.ArrayFormat.FormatVertex |
Mesh.ArrayFormat.FormatNormal |
Mesh.ArrayFormat.FormatTexUV |
Mesh.ArrayFormat.FormatIndex |
Mesh.ArrayFormat.FormatCustom0);
But then you have:
Mesh.ArrayFormat.FormatCustomBits
Mesh.ArrayFormat.FormatCustomMask
Mesh.ArrayFormat.FormatCustom0Shift
But these are somehow used to pass values in, but we're doing a bitwise OR here do how am I using these to pass values? Also where does Mesh.ArrayCustomFormat actually come into play?