Home Technical Talk

maxscript - Weld vertex selection to last selected vertex

Replies

  • r_fletch_r
    Offline / Send Message
    r_fletch_r polycounter lvl 9
    what method did you use to store selected vertex order? I did this same thing with a callback and an array of selected verts. I've found however it can get slow on large meshes
  • miauu
    Offline / Send Message
    miauu polycounter lvl 13
    Whose method is faster-your or mine?
  • r_fletch_r
    Offline / Send Message
    r_fletch_r polycounter lvl 9
    I have no idea. I was asking what you had done to get max to store selection order. I was interested if you'd taken the callback and array approach.

    Id check myself but the files are encrypted.
  • miauu
    Offline / Send Message
    miauu polycounter lvl 13
    I don't use callback. I use only arrays of selected vertices and a... some kind of hack to get the last selected vertex.

    Sorry for my english. :)
  • r_fletch_r
    Offline / Send Message
    r_fletch_r polycounter lvl 9
    Your English is geat :). Care to share the concept of how this hack works?
  • Bryan Cavett
    Offline / Send Message
    Bryan Cavett polycounter lvl 19
    I am interested in how you stored the selection order aswell. I've tried to do this in the past and could not get it working. The callback method always seemed unstable and hacky.

    Edit: Just noticed that it doesn't always get the order correct. I was trying it on a simple box and selecting verts 1 through 4 in random order in paint selection mode. It doesn't seem to like it when you are holding down the mouse button to select all the verts but if you hold, select, and release then hold and select the next vert it gets it right. Are you doing anything with the mouse down and up queries?
  • SyncViewS
    Offline / Send Message
    SyncViewS polycounter lvl 13
    Hi guys,
    I wrote a similar script some time ago for a friend. I remember I used NodeEventCallbacks. You can get it here and have a look at the code. Enjoy.
  • r_fletch_r
    Offline / Send Message
    r_fletch_r polycounter lvl 9
    Bryan: I've sent you my script that does it in a pm. check out :rt_selection_buffer_update
    Sync: thats what I used. A hack sounds interesting though :)
  • miauu
    Offline / Send Message
    miauu polycounter lvl 13
    Hi, guys!
    As I said before I don't use callback. I'm new to maxscript and... Sync, your code is too complicated to me. :)

    Here the steps that I use to get the last selected vertex:
    1. selecet some vertices - 10 for example
    2. start script
    what script do:
    2.1. store vertex selection in array
    2.2. max undo
    2.3 store vertex selection in a new array
    2.4. find the last selected vertex - the one that is in the first array, but not in the second
    2.5. max redo

    Now I have the last selected vertex and can weld all selected vertices to it. I know this is not verry elegant and may be my method is wrog, but in Editable mesh object with 690 000+faces(346000+vertices) it takes less than 3 seconds to weld 10 vertices.

    Bryan, you can use paint selection, but the last vertex must be selected with single mouse click.


    Sorry for my english
  • Bryan Cavett
    Offline / Send Message
    Bryan Cavett polycounter lvl 19
    Thanks miauu that all makes sense... clever way to do it.
  • r_fletch_r
    Offline / Send Message
    r_fletch_r polycounter lvl 9
    :) Thanks maiuu, I hadnt even given doing it that way a thought.
Sign In or Register to comment.