Hey All-
Working on a simple script to store the local vertex position. Maybe I should describe my issue, as often there is a simpler way of going about it. I want to attract a vertex to a locator based on a threshold distance. So if the locator gets closer than a given distance the given vertex is attracted to it. I plan on doing this via an expression. I know that this could be better through the api, but my python / api skills are not sufficient to pull this off. Here is the code I have for storing the local position of the verts in blind data. I am not getting any values after the first vertex / first value. Any ideas?
{
string $obj = "pPlane1";
string $verts[] =`ls -fl ($obj + ".vtx[ * ]")`;
int $id = 9002;
int $isUsed[] = `blindDataType -q -id $id`;
if ($isUsed[0] != $id)
{
blindDataType
-id $id
-dt "double" -ldn "vertexPosX" -sdn "vpx"
-dt "double" -ldn "vertexPosY" -sdn "vpy"
-dt "double" -ldn "vertexPosZ" -sdn "vpz";
}
for ($v in $verts)
{
float $vrtPos[] = `xform -q -os -t $v`;
//print ($vrtPos);
//print "\n";
polyBlindData
-id $id
-at "vertex"
-ldn "vertexPosX"
-dbd $vrtPos[0]
$v
;
polyBlindData
-id $id
-at "vertex"
-ldn "vertexPosY"
-dbd $vrtPos[1]
$v
;
polyBlindData
-id $id
-at "vertex"
-ldn "vertexPosZ"
-dbd $vrtPos[2]
$v
;
//read back information
float $bd[] = `polyQueryBlindData -id 9001 -ldn "vertexPosX" -ldn "vertexPosY" -ldn "vertexPosZ" $v`;
print $bd;
}
}