Page 1 of 2 12 LastLast
Results 1 to 15 of 17

Thread: Select vertices, which are affacted by a morph map?

  1. #1
    Registered User
    Join Date
    Jan 2013
    Location
    NA
    Posts
    64

    Select vertices, which are affacted by a morph map?

    There is a command "Select by Map" in modeler, but it don't do the job well, it also select some points which do not affacted by the morph map, those points all have 0,0,0 value by moprh map in Point Info Panel.

    Notice:This happend since I had some import\export operations with my model.

    I also try "Select By Current Morph Map" and "Select By AnyMap" from Akira Asagi, they did not work as I expected.

    Here is a little script do the job well in blender: https://blender.stackexchange.com/qu...by-a-shape-key

    Any help?
    Last edited by mewnow; 03-20-2019 at 03:15 AM.

  2. #2
    Registered User
    Join Date
    Aug 2016
    Location
    a place
    Posts
    1,614
    i think there is a plugin to remove zero value vmaps. might be part of the ys plugins

    http://www.dstorm.co.jp/dsproducts/F.../ysplugin.html

  3. #3
    Registered User
    Join Date
    Jan 2005
    Location
    Colorado Springs
    Posts
    1,739
    If you're running LW2015, there's an LScript available called SelectByMapInfluence revealed in this thread by kyuzo:

    https://forums.newtek.com/showthread...issing-lscript

    which allows a range of map values for selection. Specifying a range of anything above 0.0 may do what you want.

    It seems to be left out of the LW2018 and LW2019 kit / installation, although it works fine in LW2019. I just copied it from my LW2015 installation to the LW2019.0.2 and it works great. If you have an LW2015 installation, it's located here:

    C:\Program Files\NewTek\LW2015.3\support\plugins\scripts\LScr ipt\model\selectbymapinfl.ls

    mTp
    Last edited by MonroePoteet; 03-20-2019 at 07:18 PM. Reason: Add LW2015 location

  4. #4
    Registered User
    Join Date
    Jan 2013
    Location
    NA
    Posts
    64
    No LW2015 here, only V11.6.3. There is a command "Select By Map Influence" in V11.6.3. Seems it not works for morph maps but weight maps.

  5. #5
    Registered User
    Join Date
    Jan 2005
    Location
    Colorado Springs
    Posts
    1,739
    Ah, yes, the script seems to be specific to Weight maps rather than vertex maps in general.

    Looking at the script, it's not really feasible to do a simple adaptation to Morph maps. Morph maps have 3 "dimensions", the relative distance in X,Y and Z from the "base" morph (or absolute difference if that mode was used when the Morph was created). So determining a valid range would be difficult, since if the model is large and the morphs are quite different the relative distances could be large, while for small models and details morphs, they'd be small. As well, one relative distance may be zero while the others are not - so the Morph doesn't influence that point in that dimension!

    My experimenting in LW2019 is that points I don't move in a Morph don't have any mapped value for the Morph. I guess I'm surprised that just doing a "Select by Map" specifying the Morph map doesn't work!

    mTp


    mTp

  6. #6
    Registered User
    Join Date
    Jan 2013
    Location
    NA
    Posts
    64
    So, there isn't a ready-made "command" to do this thing...or say there isn't a easy way to do it unless I can coding a script.
    Anyway, thank you very much for helping, mTp.

  7. #7
    Registered User
    Join Date
    Jan 2013
    Location
    NA
    Posts
    64
    BTW, in LW11.6.3, there is three commands in Selection tab: "VMap Poly Select", "Select by Map", "By Vertex Map Value". They seem to do the same thing without big differences, is it necessary?

  8. #8
    Registered User
    Join Date
    Jan 2005
    Location
    Colorado Springs
    Posts
    1,739
    If you only want to select points that are both a) mapped to a selected Morph map, and b) have at least one X,Y,Z dimension within that Morph map that's non-zero, here's a quick hack of the script that may work for you.

    Note that I removed all the options except the Morph map, including the Select Polygons option. If you need the polygons selected, use the script to select the non-zero Morph map points, and then the Selection=>Polys=>Sel Polys menu entry.

    Hope it works for you!
    mTP
    Attached Files Attached Files
    Last edited by MonroePoteet; 03-20-2019 at 11:15 PM. Reason: Inverted the description!

  9. #9
    TrueArt Support
    Join Date
    Feb 2003
    Location
    Poland
    Posts
    7,809
    Quote Originally Posted by mewnow View Post
    There is a command "Select by Map" in modeler, but it don't do the job well, it also select some points which do not affacted by the morph map, those points all have 0,0,0 value by moprh map in Point Info Panel.

    Notice:This happend since I had some import\export operations with my model.

    I also try "Select By Current Morph Map" and "Select By AnyMap" from Akira Asagi, they did not work as I expected.

    Here is a little script do the job well in blender: https://blender.stackexchange.com/qu...by-a-shape-key

    Any help?

    Save duplicate (just in case) of file.

    Apply Morph.

    Make base in 1st layer, morphed and applied in 2nd layer.

    Bg To Morph will make new morph only from vertexes which are different between base and transformed state, so the all vertexes with 0,0,0 relative offset will be ignored. And Select by map should start working as expected again.
    LightWave Plugins
    Global Materials for LightWave 2019
    Custom plugin writing. Request a quote.

  10. #10
    Registered User
    Join Date
    Jan 2013
    Location
    NA
    Posts
    64
    Quote Originally Posted by MonroePoteet View Post
    If you only want to select points that are both a) mapped to a selected Morph map, and b) have at least one X,Y,Z dimension within that Morph map that's non-zero, here's a quick hack of the script that may work for you.

    Note that I removed all the options except the Morph map, including the Select Polygons option. If you need the polygons selected, use the script to select the non-zero Morph map points, and then the Selection=>Polys=>Sel Polys menu entry.

    Hope it works for you!
    mTP
    Yeah, really nice script! It did what I want. Thanks for everything, mTp.

    I don't know if it is possible, but I think it will be better if the script does its job according to the Vertex Maps Panel(F8) highlighted selection but no need another select popup.

    One more request, can I get an version that gets the invert selection automatically?

    Thanks

  11. #11
    Registered User
    Join Date
    Jan 2005
    Location
    Colorado Springs
    Posts
    1,739
    I don't see any mechanism in the LScript Scene Object Agent documentation for querying the currently selected Vertex Map from the panel or lower-right drop-down. I could SET the currently selected VMap to be whatever you choose in the script's pulldown, but I don't think I can query what's selected in Modeler. The automatic selection inversion is simply adding a selinvert() after the work is done, leaving points selected which a) are in the Morph Map and b) have ALL of the X,Y, and Z dimensions equal to zero.

    If that's what you want, it should be a few minutes worth of work.

    mTp

  12. #12
    TrueArt Support
    Join Date
    Feb 2003
    Location
    Poland
    Posts
    7,809
    In C/C++ and Python it's LWStateQuery.vmap();
    LWSDK 2019/html/globals/modstate.html

    "
    vmapname = vmap( index, lwid )
    Returns the name of the currently selected vertex map, and stores the LWID of the vmap in the second argument. The index can be one of the following.

    LWM_VMAP_WEIGHT
    LWM_VMAP_TEXTURE
    LWM_VMAP_MORPH

    "
    LightWave Plugins
    Global Materials for LightWave 2019
    Custom plugin writing. Request a quote.

  13. #13
    Super Member Kryslin's Avatar
    Join Date
    Feb 2009
    Location
    Prescott, IA
    Posts
    1,447
    I seem to remember that an index of 0 for a given map type will assign the selected vertex map to the vertex map agent...
    "The currently selected Weight, Texture or Morph vertex map can now be acquired in Modeler by providing an index value of zero (0) to the VMap() constructor when specifying one of the three vertex map types..."
    (From Mike Green's lscript documentation)(http://www.mikegreen.name/Lscript/Lscript%20Index.html)
    --------
    My Scripts for Lightwave
    Intel Core i7 960 @3.20 Ghz, 24 GB ram, EVGA 6GB GTX980Ti "Classified" driving 2 x HP LA2405.

  14. #14
    Registered User
    Join Date
    Jan 2013
    Location
    NA
    Posts
    64
    Quote Originally Posted by MonroePoteet View Post
    I don't see any mechanism in the LScript Scene Object Agent documentation for querying the currently selected Vertex Map from the panel or lower-right drop-down. I could SET the currently selected VMap to be whatever you choose in the script's pulldown, but I don't think I can query what's selected in Modeler. The automatic selection inversion is simply adding a selinvert() after the work is done, leaving points selected which a) are in the Morph Map and b) have ALL of the X,Y, and Z dimensions equal to zero.

    If that's what you want, it should be a few minutes worth of work.

    mTp
    "Do the job" by current morph map is fine, something like Select By Current Morph Map. No more select target morph map from list in a popup window.

    Thanks.
    Last edited by mewnow; 03-21-2019 at 07:45 PM.

  15. #15
    Registered User
    Join Date
    Jan 2005
    Location
    Colorado Springs
    Posts
    1,739
    Quote Originally Posted by Kryslin View Post
    I seem to remember that an index of 0 for a given map type will assign the selected vertex map to the vertex map agent...
    "The currently selected Weight, Texture or Morph vertex map can now be acquired in Modeler by providing an index value of zero (0) to the VMap() constructor when specifying one of the three vertex map types..."
    (From Mike Green's lscript documentation)(http://www.mikegreen.name/Lscript/Lscript%20Index.html)
    Yep, works great! Thanks for the pointer both to the "trick" and to Mike Green's nicely organized documentation!

    Here's the script SelectUninfluencedMorphMapPoints.ls which selects points which are either not in the Morph map at all, or have all zero "dimensions" in the map entry (i.e. no change from the base). You need to select a Morph map in the F8 vertex map panel or in the lower-right pulldown first.

    mTp
    Attached Files Attached Files

Page 1 of 2 12 LastLast

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
  •