- Home /
UV's not reapplying correctly from deserialization
I made a script that takes in all the data of a mesh, breaks down the vertices, indices of the faces, and uvs, serializes them, and then on load deserializes all that data and rebuilds the mesh. The vertices and indices work perfect, however even though I'm grabbing the uvs with Mesh.uv, when I deserialize it and reapply it, the mesh just has a color, as opposed to the texture that was on it before.
The material is applying correctly, here is my process for the uvs:
Grab the uvs with Mesh.uv, break down the vector 2 array and place each x and y value into a float list. When i pull it back I use a for loop, starting at 0, grabbing x and x+1 of the list, putting it into a vector 2, adding it to an array (well rather adding it to a list, then looping through the list to add to an array), then adding 2 to x. This in theory should get me all the uv's in the correct order, and then I reapply the array with Mesh.uv.
This however doesn't work as expected. If anyone has any ideas please let me know. Thanks!
Your answer
Follow this Question
Related Questions
Procedural Mesh UVing 2 Answers
Updating UV in imported mesh without having to re-material 0 Answers
PackTextures: many materials or many meshes? 1 Answer
Apply UV to procedural mesh 1 Answer
"Mesh indices out of range" when using ObjExporter 0 Answers