PDA

View Full Version : How to make a script select certain points?



whattawa
08-26-2003, 08:53 PM
I was trying to put together a script that would select all points that are affected by a morph.

Functionally, I would like it to work so that the user turns on a Morph, runs a script, and all points that are affected by the morph would then be selected. Anybody know how to get the script to select points that are affected by a vmap?

For what it is worth, here is the attempt:

main
{
vmap = VMap(VMMORPH) || error("No VMAP selected!");
selmode(USER);
editbegin();
foreach(p,points)
{
if(vmap.isMapped(p))
{
selpoint(SET, POINTID, p);
}
}
editend();
}

Tom Speed
08-26-2003, 11:47 PM
Hi,

Almost got it there :)

Use VMap(<vmap type>,0); to get the currently selected VMap of the type specified.

Also, selpoint() can't be called between editbegin() <> editend() as it is a Command Sequence function.




main
{
vmap = VMap(VMMORPH,0) || error("Please select a Morph Map from the drop down list (bottom right 'M' button)");
selmode(USER);
editbegin();
foreach(p,points)
if(vmap.isMapped(p))
pntIDs += p;

editend();

if(pntIDs)
{
selpoint(CLEAR); // clear any old selection
selpoint(SET, POINTID, pntIDs);
}
}



Cya!
Tom

whattawa
08-27-2003, 02:28 PM
Thanks for the help! It works great the first time I run it! After that, though, I can't run it anymore until I restart Modeler. I'll have to look into why that is...Great stuff, though. I have so much to learn.