[MAX]Layer operations getting VERY slow with many layers

Hi there,

another performance issue i am trying to tackle. While it is normal that the performance of something like the layer system is dependent on the amount of layers, but this seems over the top. In the current case deleting many layers (around 800 of 1000) is taking around 12 minutes. It does not seem to matter if i do that via our in-house layermanager, max’s layer dialog or a straightforward scripted implementation. As said that seems a tad over the top. Note that deleting 13.000 objects to empty the layer as they need to be empty to be deleted takes like 30 Seconds in comparison.

Any special tricks i am missing in regards to handling layers?

I am currently preparing a bit of benchmarking. As a quick test i did a macro creating 10 layers. If you subsequently click that you can see performance getting slower each click with around 200 layers it’s already a real drag.

Regards,
Thorsten

I thought I used layers heavily. Our largest scenes possibly consisted of less than 100. However, you clearly win with the amount of layers in one scene. One trick I picked up was that making sure the dialog is closed is the biggest help here as the refreshing of creating/removing and refreshing layers can be quite slow with it open.

I’m not going to try to understand how you can possibly use that many layers but if you are having these kind of issues it might be worth investigating another manner in which to organize your scene objects. I currently do this with custom attributes to associate objects together, I previously used user defined properties, but switched to custom attributes as they are transferable within FBX. I then had my own scene manager to associate the attribute objects into “Assets” by scraping the scene of all the object attributes. I still used the layer manager but only to exclusively group the objects in major buckets. You may have seen my post of this earlier but in case you haven’t there is a video of how it works.

3dsmax-animation-referencing-and-scene-building

Interesting and will definitely look into different ways. We are working with configurable car data, the layers are corresponding to xref and content is dynamically loaded and unloaded depending on the configuration. Seems we reached the limit of layer count that is reasonable to work with heh.

Wow, that IS a lot of layers.

We have a custom layer deleting script. It’s more or less instant (about 5 seconds for 100 layers from my test). But then we don’t use anywhere near that many layers. I couldn’t be bothered to try and create more than 100 to test it. I have no idea how it would perform with 1000 layers. I suspect if you force the window to close or disable redraw before the script runs it would be faster.

Many things in max force the display to refresh every action unless you force it not to. Just try running the keyframe reduction on many tracks of many objects in the track view. I had to do that on 800 objects for position and rotation when they were baked physics objects a while back. Took all WEEKEND. I could watch each keyframe being removed one after the other and the display updated for each one. I got a tool to do it automatically on export a while later and now it’s done transparently in about 5 seconds.

I have done a bit of research and present to you mighty graphs to illustrate the issue. After my recent tests i conclude that the max layer system simply is not designed to handle that many layers. The time taken for layer operations (switching on/off, creating, deleting) is growing exponentially with the amount of layers in the scene. So here’s two quick benches on that.

In the first one i am creating 1000 layers and measure the time taken for each newLayer call. Time is on y in seconds, current layercount on x

In the second one i am doing the same, but after creating the layer i switch one layer (the first one) off, and back on. The time measured is only for the switch, excluding creation

So it seems we reached a point were layers are pointless (hrhr)

Regards,
Thorsten