Results 1 to 8 of 8

Thread: Vertex map creations

  1. #1

    Vertex map creations

    Hello,
    I was wondering how to create a new morph Vmap.
    Can't find the answer in LScript documentation.

    Thanks
    Maurizio Memoli

  2. #2
    Newbie Member Tom Speed's Avatar
    Join Date
    Feb 2003
    Location
    Liverpool, England
    Posts
    86
    Hi,

    Here's an example:

    Code:
    @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

  3. #3
    Tom, is it the same way to create Weightmap?

  4. #4
    Newbie Member Tom Speed's Avatar
    Join Date
    Feb 2003
    Location
    Liverpool, England
    Posts
    86
    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

  5. #5
    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?
    Last edited by papou; 09-22-2003 at 03:56 PM.

  6. #6
    Worms no more! Free fun! Dodgy's Avatar
    Join Date
    Feb 2003
    Location
    Sydney
    Posts
    8,275
    Could it be your calling it myWmap in one part and myVmap in another?

  7. #7
    OOoooO sorry,
    U right thank you!
    great,

  8. #8
    Thanks a lot!
    Another question what about Absolute Morph map creation?

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •