PDA

View Full Version : Removing or Defragging Gaps in Layers



Remoc
04-27-2013, 07:15 AM
I have recently been editing a FBX model supplied by an architech.
Upon import it created 8000+ Layers. ( it's a huge sporting complex )

I since then I have removed many uneeded layers and moved many around.

Now I have lots of gaps in my Layers.

Is there a way to remove the empty layers only?
Maybe someone could program a DEFRAG plugin/script for modeler. :)

Thanks in advance.

Remoc

jboudreau
04-27-2013, 07:30 AM
Hi Remoc

You can try these plugins. I haven't them before but it sounds like what you are looking for.

http://www.lwplugindb.com/plugin/layer-tools-1/

http://www.lwplugindb.com/plugin/layer-tools/ (I think this one is exactly what you need)

Thanks
Jason

Remoc
04-27-2013, 08:09 PM
Thanks for the response..

However the Layer_Remove.ls from the first link gives me an error "Line 20, invalid argument 1 type to size()"

and the lyr_cleargaps.ls from the second link says "What do you mean? There don't appear to be any layers in this object."

I know I have thousands of layers. I wonder if there is a problem with my LWO or the scripts?

I have tried both 32bit & 64bit versions of Lightwave 11.5

I noticed the scripts were produced many some years ago, maybe not compatible with 11.5?

Any other suggestions?

Paul_Boland
04-27-2013, 08:19 PM
8000+ layers!! WOW!!! Would love to see a pic of the model if you are allowed to post one.

Remoc
04-27-2013, 11:39 PM
Its not that super complex, although it did have toilets, sink, shower heads, desks, computers ect. ( which I have since removed )
It's a result of how I got it into Lightwave.

It was supplied exported from Autodesk Revit as a FBX.
Then I imported into 3D Studio Max 2012, then exported out as a FBX. ( The Revit FBX would not import directly into Lightwave )
Then as the FBX imported into modeller it produced a Layer per item. And materials were listed as Material 564433, Material 564434 ect.

So I manually have been cutting similar layers ( items ) into their own layers, and resurfacing them with more logical names as I go.
Now I need a way to remove all the layer gaps.

The Layer <> button at the top only goes to Layer 99. Yet in the F7 Layers panel I can see all 8000+ Layers.
I think the scripts use cut and paste, and the top button to do their thing, but because I have more then 99 layers, the scripts fail.

Surrealist.
04-28-2013, 02:53 PM
Not the automated solution but as you go you can be just using the delete key in the Layer Panel to delete empty layers. Going back, a lot of work, but as you go it would be quick enough. In any case it works.

nickdigital
04-28-2013, 03:46 PM
The Layer <> button at the top only goes to Layer 99. Yet in the F7 Layers panel I can see all 8000+ Layers.
I think the scripts use cut and paste, and the top button to do their thing, but because I have more then 99 layers, the scripts fail.

I'm not even sure how you can access the data past the maximum number of layers in the ui. When I click on a layer in the Layers panel it doesn't highlight my layer in the UI. My guess is this is a limitation in lscript. I'm gonna fogbugz this for NewTek.

Can you post the model? In my crude tests Kevin's script works.

Remoc
04-28-2013, 10:54 PM
Model attached as password protected ZIP

I will PM you the PW Nick.

Let me know if you find a way.

Cheers,

Remoc

tcoursey
04-29-2013, 08:01 AM
Its not that super complex, although it did have toilets, sink, shower heads, desks, computers ect. ( which I have since removed )
It's a result of how I got it into Lightwave.

It was supplied exported from Autodesk Revit as a FBX.
Then I imported into 3D Studio Max 2012, then exported out as a FBX. ( The Revit FBX would not import directly into Lightwave )
Then as the FBX imported into modeller it produced a Layer per item. And materials were listed as Material 564433, Material 564434 ect.

So I manually have been cutting similar layers ( items ) into their own layers, and resurfacing them with more logical names as I go.
Now I need a way to remove all the layer gaps.

The Layer <> button at the top only goes to Layer 99. Yet in the F7 Layers panel I can see all 8000+ Layers.
I think the scripts use cut and paste, and the top button to do their thing, but because I have more then 99 layers, the scripts fail.

You'll find that with all those surface names modeler/layout may run slow. I do similar work with similar files. Usually I just go in and remove what I don't wnat (like your doing) and then select by connected and then merge layers together by cutting and pasting similar things together. Doind my own defrag of sorts.

Other method is don't have LW put each part in it's own layer. But then your left with a huge poly object in one layer that you then begin to seperate manually. I've worked both ways. They are a pain! Good luck.