I'm trying to write a simple script that draws curves between selected vertices. Right now I'm just trying to get it so you highlight the vertices of an object, run the script and it creates curves that start at the vertices and end at (0,0,0). I'm not getting any error messages, but no curves are being made. I don't think the vertices are being stored in my vertexNames array. Do you see something messed up here? I'm just getting started with MEL so any advice is very appreciated!
Just to simplify what I'm trying to do:
- put the user's selection in an array
- pull the vertexes out of that selection and put them in an array
- for each vertex make a curve that starts at the vertex and ends at the middle of the scene
string $selection[] = `ls -os -fl`;
string $vertexNames[] = `filterExpand -selectionMask 31 -expand true $selection`;
string $objectToInstance = $selection[0];
if(`objectType $objectToInstance` == "transform"){
string $vertex;
for($vertex in $vertexNames){
curve -p $vertex -p 0;
}
}