Firas
04-24-2005, 11:27 AM
hi..
can u help me in wrting a mel using closestPointOnSurface to shrinkWrap vertices to a nurbs surface ..
i did this small one using closestPointOnMesh for vertices to vertices wraping.. but i need it to nurbs surface now :(
$BaseObj = "Base";
$selectedVTX = `ls -sl -fl`;
selectMode -o;
toggleSelMode;
SelectToggleMode;
$selectedObj = `ls -sl`;
//copy vtx to memory
if (size ($selectedObj) == 1)
{
$copySource = $selectedObj[0];
for ($vtx in $selectedVTX)
{
$pp = `xform -q -t -ws $vtx`;
//string $myCPOM = `closestPointOnMesh -na "myClosestPointOnMesh" -ip 0 0 0 "myPolyModel"`;
float $result[] = `closestPointOnMesh -ip $pp[0] $pp[1] $pp[2] -q -p "BaseShape"`;
float $positionX, $positionY, $positionZ;
$positionX = $result[0];
$positionY = $result[1];
$positionZ = $result[2];
xform -ws -t $positionX $positionY $positionZ $vtx;
}
}
select -r $selectedVTX;
selectMode -co;
hilite -r modeling ;
Big Thankx for Help.
can u help me in wrting a mel using closestPointOnSurface to shrinkWrap vertices to a nurbs surface ..
i did this small one using closestPointOnMesh for vertices to vertices wraping.. but i need it to nurbs surface now :(
$BaseObj = "Base";
$selectedVTX = `ls -sl -fl`;
selectMode -o;
toggleSelMode;
SelectToggleMode;
$selectedObj = `ls -sl`;
//copy vtx to memory
if (size ($selectedObj) == 1)
{
$copySource = $selectedObj[0];
for ($vtx in $selectedVTX)
{
$pp = `xform -q -t -ws $vtx`;
//string $myCPOM = `closestPointOnMesh -na "myClosestPointOnMesh" -ip 0 0 0 "myPolyModel"`;
float $result[] = `closestPointOnMesh -ip $pp[0] $pp[1] $pp[2] -q -p "BaseShape"`;
float $positionX, $positionY, $positionZ;
$positionX = $result[0];
$positionY = $result[1];
$positionZ = $result[2];
xform -ws -t $positionX $positionY $positionZ $vtx;
}
}
select -r $selectedVTX;
selectMode -co;
hilite -r modeling ;
Big Thankx for Help.
