I'm currently trying to modify the vertex attributes of a mesh at run time, more specifically, the color of each vertex. I want it to be done without ImmediateGeomety. How can I do that?
Here is a piece of my code.
var mesh_data = MeshDataTool.new()
var image = color_array.get_data()
for surface in range(mesh.get_surface_count()):
for vertex in range(mesh_data.get_vertex_count()):
var UV = mesh_data.get_vertex_uv(vertex)
var pixel = UV*image.get_size()
The code is supposed to work on a .obj file exported from Magicavoxel, saving the texture color array corresponding pixels in the vertex colors. The colors are not the corresponding ones though and I can't tell what's wrong.