I suggest using //Mel string $vertices[] = `filterExpand -sm 31`; for querying the selected vertices instead. You never know if the user might select something else which should not be selected for the script. filterExpand 31 ensures you get only selected vertices, see the docs for which number is used for other components.
Is it possible to create a simple script to make all selected vertices to snap to closest locators. I'm still new to mel scripting. any help is appreciated.
Forgot to include a image. my bad here it is what im trying to achieve is have all the selected vertices snap to nearby locators. Im assuming with xform or getAttr to retrieve the location of the locator and then test closest distance. But I have no idea how to do it with more then 2 objects.
Thanks a lot for everybodys help on this. The script works perfectly. But now i run into another problem. First I must explain the purpose for requesting this script. This is part of the main Script Im trying to write which is Quad fill (imitating Quad-cap max plugin by obliviboy). So far Ive been sampling many mel scripts…