Hello Guys,
I am currently working on my Bachelor Thesis for which I am developing a textureless workflow with Unity and MayaLT. I wanted to push as much Vertex information into the modell as possible. As Unity supports only one Vertex Color Channel, I am running into problems. This single Vertex Color Channel is color and baked occlusion information. Now I wanted to create metall and smoothness Information as vertex colors which are only greyscale. What I am now trying is to write a MEL Script which puts the vertex colors into the uv's. I found a script in python for blender which is capable of doing this :
http://answers.unity3d.com/questions/137453/multi-layered-texturing-multiple-vertex-color-sets.htmlThis is my first try with MEL and I am now a little stuck. This is what I got:
//creating a new uv set
polyUVSet -cr -uvs "Metallic";
//set metallic as active uv set
polyUVSet -currentUVSet -uvs "Metallic";
//convert the object selection into vertex selection
ConvertSelectionToVertices;
//select metallic vertex color set as active
polyColorSet -currentColorSet -colorSet "Metallic";
Not much, I know. I am now asking, is it even possible to write such a script in MEL?
Thanks for you answers
Andreas
Replies
This should work. Some untested code:
Then transform 'uv' to U=1,V=0, then transform the inverse selection to U=0,V=0.
I've stored various things into vertex colors and UVs. On my previous project I stored transforms for morph targets on a static mesh. So there ways to use extra vtx clrs or uvs that don't have the overhead of a texture sample. I don't think metalness is one of them to be honest. The distance between vertices is going to cause gradients along polygons, this may make the material appear strange. But I suppose for your project the trade off for visual quality is improved memory. UV sets aren't necessarily 'free' though.