fghajhe
06-10-2012, 02:59 PM
Hi,
I am trying to write a small script to copy vertex colors to UVs. The problem I am having is I want to efficiently copy the vertex value to the uv position. I can do something like this but its slow becuase it has to go through each vert individually and perform the operations, so for 100k+ verts it takes forever.
PolySelectConvert 3;
string $vertices[]=`ls -sl -fl`;
for ($vert in $vertices)
{
select $vert;
float $red[] = `polyColorPerVertex -q -r`;
PolySelectConvert 4;
polyEditUV -r 0 -u $red[0] ;
}
I want to do something where I copy and paste the whole array into the UVs. I think the code below is on the right track but I have a syntax error becuase it wants the array $red to be $red[0]. I dont want to copy just the first value of the array but the whole array to I guess an array of UVs. Is this possible?
PolySelectConvert 3;
float $red[] = `polyColorPerVertex -q -r`;
PolySelectConvert 4;
polyEditUV -r 0 -u $red;
I am trying to write a small script to copy vertex colors to UVs. The problem I am having is I want to efficiently copy the vertex value to the uv position. I can do something like this but its slow becuase it has to go through each vert individually and perform the operations, so for 100k+ verts it takes forever.
PolySelectConvert 3;
string $vertices[]=`ls -sl -fl`;
for ($vert in $vertices)
{
select $vert;
float $red[] = `polyColorPerVertex -q -r`;
PolySelectConvert 4;
polyEditUV -r 0 -u $red[0] ;
}
I want to do something where I copy and paste the whole array into the UVs. I think the code below is on the right track but I have a syntax error becuase it wants the array $red to be $red[0]. I dont want to copy just the first value of the array but the whole array to I guess an array of UVs. Is this possible?
PolySelectConvert 3;
float $red[] = `polyColorPerVertex -q -r`;
PolySelectConvert 4;
polyEditUV -r 0 -u $red;
