Home Coding, Scripting, Shaders

max "element" selection cache

ngon master
Offline / Send Message
Klunk ngon master
I've come across a strange issue with elements on meshes..... I was playing around with my own face detach routine as you do :) It all works fine and as expected but it seems max has "pre-cached" the faces that make up each element for the purposes of speeding up subobject element selection so after the detach when you use element select it still selects the entire mesh.... if you do a convert to mesh you can then select the seperated element... add any mod like mesh select and you can select the seperated element even if you add any mod and delete it you can select the new element. I've looked through the doc and can't find the function that clears this "cache". Anyone found a solution to this oddity ?


I detach the selection and then move it and enter element subobject mode and pick any face....

Replies

  • poopipe
    Offline / Send Message
    poopipe grand marshal polycounter
    Assuming the process is .. 
    select faces, detach to element, move faces, select other element in element subobject mode.... 

    I'm not getting it on max 2023 with editable poly or editable mesh objects or with edit-poly/ edit-mesh modifiers 
    its the only version i have installed on this machine - what are you on?
  • Klunk
    Offline / Send Message
    Klunk ngon master
    It's a custom sdk function not a default max action or script

  • poopipe
    Offline / Send Message
    poopipe grand marshal polycounter
    ah right - then i am no use to you at all :)
  • Klunk
    Offline / Send Message
    Klunk ngon master
    you can replicate it with the attached script  after it's run goto element subobject selection and pick a face

  • Klunk
    Offline / Send Message
    Klunk ngon master
    It appears to only occur when the mesh is in subobject edit mode when the detach is done. :/
  • Klunk
    Offline / Send Message
    Klunk ngon master
    found the fix for the sdk function.... seems it's a thing with editable mesh interface i.e. when it's being edited so you have to enclose your code with....

    MeshDeltaUser* mdu = (owner) ? GetMeshDeltaUserInterface(owner) : NULL;
    if (mdu && mdu->Editing()) mdu->ExitCommandModes();

    ......
    if(mdu)  mdu->LocalDataChanged(ALL_CHANNELS);

    which forces the editable mesh interface to update it's shit, not sure how that would relate to the scripted version, probably just unselect it i guess 
    just setting the subObjectLevel to zero before calling the detach does the trick.

    the edit mesh doesn't cache the elements per se but does cache a face adjacency list which is then used to collect the elements during the pick mode...
    and the MeshDeltaUser interface is the only way to invalidate the adjacency list :/


Sign In or Register to comment.