Results 1 to 6 of 6

Thread: Remove Unselected Layers - error

  1. #1

    Remove Unselected Layers - error


    hi, found this by Glenn Tester
    https://www.lightwave3d.com/assets/p.../layer-tools-2

    does anyone know why it can't run ?


    @script modeler
    @name "Remove Unselected Layers"
    @version 2.3

    main

    {
    mesh = Mesh(0);
    selmode(USER);
    pointcount = pointcount();
    polycount = polycount();
    BGLayers = lyrbg();


    editbegin();
    pointids = points;
    editend();

    for (p = 1; p <= pointcount; p++)
    {
    SelLayers += mesh.layer(pointids[p]);
    }
    SelLayers.sortA();
    SelLayers.reduce();
    lyrsetfg(SelLayers);
    lyrsetbg(BGLayers);
    }
    LW vidz   DPont donate   LightWiki   RHiggit   IKBooster   My vidz

  2. #2
    Super Member Kryslin's Avatar
    Join Date
    Feb 2009
    Location
    Prescott, IA
    Posts
    1,436
    What error is it tossing back to you?
    --------
    My Scripts for Lightwave
    Intel Core i7 960 @3.20 Ghz, 24 GB ram, EVGA 6GB GTX980Ti "Classified" driving 2 x HP LA2405.

  3. #3

    it simply doesn't run. can hardly recall previously released LW Scripts having problems, so not sure what this could be.
    Last edited by erikals; 12-29-2018 at 05:34 PM.
    LW vidz   DPont donate   LightWiki   RHiggit   IKBooster   My vidz

  4. #4
    TrueArt Support
    Join Date
    Feb 2003
    Location
    Poland
    Posts
    7,772
    This script is ridiculous. It's getting quantity of points in entire object (could be multimillion). Then going through the all points, and adding one by one layer of current point to the list.. So if you have multimillion point object, generated list "SelLayers", will have multimillion entries..
    Proper code should go through the all foreground layers, check if they have some points, and whether points are selected by user, if any point is selected in layer, add layer to the list.
    LightWave Plugins
    Global Materials for LightWave 2019
    Custom plugin writing. Request a quote.

  5. #5

    still, should have worked, since i used it on objects with a total of ~20 polys.

    thanks for the info looks like i'll give this script a rest.
    LW vidz   DPont donate   LightWiki   RHiggit   IKBooster   My vidz

  6. #6
    Super Member Kryslin's Avatar
    Join Date
    Feb 2009
    Location
    Prescott, IA
    Posts
    1,436
    This script may have been written before the .indexOf() function was added.

    I agree with Sensei, though, this could be done better.
    --------
    My Scripts for Lightwave
    Intel Core i7 960 @3.20 Ghz, 24 GB ram, EVGA 6GB GTX980Ti "Classified" driving 2 x HP LA2405.

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
  •