Home Technical Talk

[maya] Copying vertex color information

Hey ppl,

Does anyone know an easy way to copy the vertex color information from the red channel to the alpha channel in maya? (maybe sombody knows/has a script or something?) I could do it by hand, but that takes ages...

Thanks in advance!

Replies

  • r4ptur3
    Options
    Offline / Send Message
    r4ptur3 polycounter lvl 10
    hey dude!

    I don't think there is an easy way to do it ... you are probably going to have to bake a map out (hopefully your UVs are not overlapping) and then transfer it to the channel of your choosing.
  • haiddasalami
    Options
    Offline / Send Message
    haiddasalami polycounter lvl 14
    Ill try and take a stab at it tomorrow. You can query vertex colors so something that you can do is query the red channel and just assign to second mesh since it'll have the same vert'id count.
  • throttlekitty
    Options
    Offline / Send Message
    I really wish the component editor let you copy/paste or move columns of data around like one could with Excel.
  • Lamont
    Options
    Offline / Send Message
    Lamont polycounter lvl 15
    Here, I put comments so you see how it works in case you want to pull blue and put in alpha or something... Tested on Maya 2010...

    //Your Selection Mode, we want verts
    PolySelectConvert 3;
    
    string $myVerts[]=`ls -sl -fl`;
    
    for ($vert in $myVerts){
    select $vert;
    //We are getting Float values from the red "r" channel, that last item means red btw...
    float $targetAlp[] = `polyColorPerVertex  -q -r`;
    //We pick out the alpha and apply the red to each one, this is slow on large objects....
    polyColorPerVertex -a $targetAlp[0];
    }
    
Sign In or Register to comment.