THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 27/04/2009 at 07:22, xxxxxxxx wrote:
The above answers your initial question. But if the question was "how do I get the UV values of the UV-points currently selected in BodyPaint?", the answer is a bit more detailed...
First:
//--------- S N I P ---------
// if we got here, we're in point mode, so let's check the current uvpoint selection
// for this, we first need a TempUVHandle...
TempUVHandle *pTempUV = GetActiveUVSet(m_baseDoc, GETACTIVEUVSET_POINTSELECTION);
if( !pTempUV )
{
return; // Failure
}
BaseSelect *pUVSelected = pTempUV->GetUVPointSel();
if( !pUVSelected )
{
FreeActiveUVSet(pTempUV);
return; // Failure
}
//--------- S N I P ---------
...you now have a regular BaseSelect that you can process, but you need to split the values contained in it to extract the polygon vs point indices...
//--------- S N I P ---------
LONG ndx, seg = 0, smin, smax;
while( pUVSelected->GetRange(seg++,&smin,&smax) )
{
for( ndx=smin; ndx<=smax; ndx++ )
{
UVWStruct uvw;
LONG polyNdx;
polyNdx = ndx >> 2; // first determine which poly this is (divide by 4)
uvw = m_uvTag->Get(polyNdx);
switch( ndx % 4 ) // next determine which point by: ndx mod(4)
{
case 0: // do something with uv-point A
break;
case 1: // do something with uv-point B
break;
case 2: // do something with uv-point C
break;
case 3: // do something with uv-point D
break;
}
}
}
//--------- S N I P ---------
...finally, make sure to free up the TempUVHandle when done...
//--------- S N I P ---------
FreeActiveUVSet(pTempUV);
//--------- S N I P ---------