Mayaの頂点カラーを流し込むmel
一応これもUPしておく。
練習で作りました。
//コマンドラインにcolorSet と打ち込んで使用。ファイル名は適当でおkです。
//頂点選んでgetボタンでスポイトしてsetボタンで頂点orオブジェに流し込み。
float $colR;
float $colG;
float $colB;
global proc getColor()
{
global float $colR, $colG, $colB = 0;
float $val[];
$val = `polyColorPerVertex -q -r -g -b`;
$colR = $val[0];
$colG = $val[1];
$colB = $val[2];
}
global proc selectColor()
{
global float $colR, $colG, $colB;
polyColorPerVertex -rgb $colR $colG $colB;
}
global proc colorSet()
{
window -wh 100 50 -title "colorSet" ;
columnLayout -adjustableColumn true;
button -label "Get" -command "getColor";
button -label "Set" -command "selectColor";
showWindow;
}
練習で作りました。
//コマンドラインにcolorSet と打ち込んで使用。ファイル名は適当でおkです。
//頂点選んでgetボタンでスポイトしてsetボタンで頂点orオブジェに流し込み。
float $colR;
float $colG;
float $colB;
global proc getColor()
{
global float $colR, $colG, $colB = 0;
float $val[];
$val = `polyColorPerVertex -q -r -g -b`;
$colR = $val[0];
$colG = $val[1];
$colB = $val[2];
}
global proc selectColor()
{
global float $colR, $colG, $colB;
polyColorPerVertex -rgb $colR $colG $colB;
}
global proc colorSet()
{
window -wh 100 50 -title "colorSet" ;
columnLayout -adjustableColumn true;
button -label "Get" -command "getColor";
button -label "Set" -command "selectColor";
showWindow;
}