PDA

View Full Version : vmap relate



zyhsu
03-03-2004, 07:31 AM
Hi!
I use the following code to create a new morph map named "ne", but the map is not created,

editbegin();
vmap = VMap(VMMORPH,"ne",2);
info(vmap);
editend();

Could sommebody tell me why?
Thanks!

#lwrs_web
03-03-2004, 11:19 AM
try info(vmap.name);

BTW: I think a morph map has 3 values (x/y/z).

GregMalick
03-05-2004, 12:05 AM
This was posted in this forum by Tom Speed on 09/2003:

Here's how to Create a Morph Map

@version 2.6
@warnings

main
{
selmode(GLOBAL); // we'll access ALL points regardless of selection
editbegin(); // mesh edit mode

myVmap = VMap(VMMORPH,"Name Here",3); // create a Relative morphmap with 3 elements, x,y,z

if(!myVmap) error("Could not create the VMap");

foreach(p,points)
{
// assign the x,y,z values for this point to an array, I'll just use 1,2,3 in this example
values[1] = 1; // x value
values[2] = 2; // y
values[3] = 3; // z

myVmap.setValue(p,values); // set this points x,y,z in this morphmap
}
editend(); // end mesh edit session, morphmap now exists
}


--------------------------------------------------------------------------------


To create an Absolute morphmap, use VMSPOT instead of VMMORPH, everything else remains the same.

our thanks to Tom for his insight....