Remove Unselected Layers - error

hi, found this by Glenn Tester

does anyone know why it can't run ?

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


mesh = Mesh(0);
pointcount = pointcount();
polycount = polycount();
BGLayers = lyrbg();

pointids = points;

for (p = 1; p <= pointcount; p++)
SelLayers += mesh.layer(pointids[p]);

it simply doesn't run. can hardly recall previously released LW Scripts having problems, so not sure what this could be.
Last edited:


TrueArt Support
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.

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.


Active member
This script may have been written before the .indexOf() function was added.

I agree with Sensei, though, this could be done better.
Top Bottom