I have a complex model saved from mayavi library in python and its colors are saved at Vertex paint.

My final goal is to import this model into Unity with textures.

And Only way I found is, import this model first into Blender, create a new image in UV/Image mode; select all vertices of model, Bake it; and I get that new image as the texture file.

Is there any simpler way? where I can export the model from blender with its Vertex paint (if possible as texture) as .fbx or .3ds or .obj

Thanks in advance.

  • $\begingroup$ vector paint is vertex paint right? bakign the colour map is the best way to get a texture of your vertex paint. But if you are just using vertex paint it's probably a lot more efficient to use a vertex paint shader in Unity. $\endgroup$ – Firewill Jul 4 '17 at 1:46
  • $\begingroup$ @Firewill, I'm sorry; I meant vertex paint. In the endl I just want the color to show up in Unity when I import the object. Can you please explain more of how to use the vertex paint shader in Unity? OR Is there a way/ or a script to bake color map for any given object? Because; in the end; You're a life saver man. Thanks $\endgroup$ – Abhijit S Jul 5 '17 at 19:02
  • $\begingroup$ you can look at this link forum.unity3d.com/threads/… defaxer made some shaders focusd on VP. Also this here is a minimal vertex paint shader, outputting unlit vertex colors: pasteall.org/460319 , that worked in unity 5. ... 2? I think, there may have been some changes, I UNITY_MATRIX_MVP was renamed, not sure. If you want to learn more about HLSL I recommend first, to read the unity documentation, they have some pretty simple examples, also check out alanzucconi.com/tutorials he has some pretty cool tutorials! $\endgroup$ – Firewill Jul 5 '17 at 20:20
  • 1
    $\begingroup$ link is exactly what I was looking for; Thank you so much. Saved my day \m/ $\endgroup$ – Abhijit S Jul 5 '17 at 20:53

If anyone stuck in the same dilemma; Here's a solution.

And @Firewall's comment showing the shader script can also be implemented.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.