Hey aen, thats a really handy insight, I will have to take your advice on that one.
Before I do get into trying it that way I would like to show a slighty revised version
of the one I have at the moment, as it seems to be getting closer.
I have revised the latest piece of code on the locator's movement.
When the loop is done it now selects the end one so it's getting there, now instead of
just selecting the end one how would I go about keeping each faceIndex selected, or
at least put in an array, so I can select the array once the loop has finished.
I promise to stop with the annoying questions, for a little while at least ; ) , if I can get this to work lol.
for ($i=1;$i<5;$i++){
spaceLocator -n ("locator" + $i);
move (rand(-10,10)) 0 (rand(-10,10));
// create nearestPointOnMesh node
//string $nearestPoint = eval("createNode nearestPointOnMesh -n npom1");
string $nearestPoint = createNode nearestPointOnMesh -n ("npom" + $i)
;
//connect it to the polymesh
connectAttr -f pPlane1.worldMesh ($nearestPoint + ".inMesh");
//connect locator1 pos' to nearestPointOnMesh pos'
connectAttr -f (("locator" + $i) + ".translateX") (("npom" + $i) + ".inPositionX");
connectAttr -f (("locator" + $i) + ".translateY") (("npom" + $i) + ".inPositionY");
connectAttr -f (("locator" + $i) + ".translateZ") (("npom" + $i) + ".inPositionZ");
//store face index
int $selFaces = getAttr (("npom" + $i) + ".nearestFaceIndex")
;
select -add pPlane1.f[$selFaces];
}
Many thanks,
Chris