PDA

View Full Version : point selection set



zyhsu
05-24-2004, 10:41 AM
Hi!

1. How do I select point selection set in modeler using L-script?
2. I try to use selectvmap:

selectvmap(MORF,"m1");
or
selectvmap("MORF","m1");
(note: I aready set a morph group "m1")

but get a message "1st argument is invalid",

then I try to use:

selectvmap("SPOT","s1");
(note: I aready set a point group "s1")

no error message but nothing happen,
Please tell me why?

Thanks a lot!

evenflcw
05-24-2004, 12:06 PM
First of all, to specify vmap type use the forms listed at the start of Chapter 14 in the Lscript Reference Manual (ie WMMORPH, not MORF)!

Second, selectvmap() will not select any points, instead it will simply change the active vmap (the vmap displayed at the lower right corner of Modelers interface). To acctually select the points based on a vmap I think you'll have to run through all the points and check which ones are mapped. This example script will select the points used in the active morph:



main
{
selmode(USER);
selpoint(CLEAR);

if(pointcount() == 0)
return;


editbegin();

//Make the active morph a variable so we can work with it.
ActiveMorph = VMap(VMMORPH, 0);
if(!ActiveMorph)
error("Error!");

//Scan through all points and place the ones that appear in the vmap into an array.
foreach(pnt, points)
{
if(ActiveMorph.isMapped(pnt))
ActiveMorphPnts += pnt;
}

editend();


//Select the points contained in the array.
selpoint(SET, POINTID, ActiveMorphPnts);
}

zyhsu
05-24-2004, 07:05 PM
Thanks evenflcw!
this help a lot!