PDA

View Full Version : Vertex map creations



Lightsurfer
09-22-2003, 01:21 AM
Hello,
I was wondering how to create a new morph Vmap.
Can't find the answer in LScript documentation.

Thanks
Maurizio Memoli

Tom Speed
09-22-2003, 07:47 AM
Hi,

Here's an example:





@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
}


Should work :)

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

Cya!
Tom

papou
09-22-2003, 02:04 PM
Tom, is it the same way to create Weightmap?

Tom Speed
09-22-2003, 02:34 PM
Hi,

Yeah pretty much:

myWmap = VMap(VMWEIGHT,"name",1);

The number 1 is the amount of elements, weightmaps have 1 element, UVs have 2, morphmaps have 3


Tom

papou
09-22-2003, 03:45 PM
thank you!
ups, i got an error with this script:

@version 2.6
@warnings

main
{
selmode(GLOBAL);
editbegin();

myWmap = VMap(VMWEIGHT,"weight",1);

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

foreach(p,points)
{
values = 100; //weight value
myVmap.setValue(p,values);
}
editend();
}

i got the message error "Coundn't create"!
What's wrong with this script?

Dodgy
09-22-2003, 04:16 PM
Could it be your calling it myWmap in one part and myVmap in another?

papou
09-22-2003, 04:30 PM
OOoooO sorry,
U right thank you!
great,

Lightsurfer
09-23-2003, 02:03 AM
Thanks a lot!
Another question what about Absolute Morph map creation?