Maya – display override issue with display layers

There is a small issue with deleting display layers in Maya that have already objects assigned to them. Usually when you add objects to a display layer the drawing overrides are turned on to be controlled by the display layer. The bugging part is, when you delete the layer the drawing override will remain being turned on and this prevents the objects to follow any layer setting when they are later put into a group which is assigned to a layer.

It always bugged me when I was modeling, putting some objects on a layer for better scene management, just to find out later, when these objects are in their final hierarchies ready for animation, that the layer setting won’t get inherited by these objects, i.e. setting a layer the referenced the object would be still selectable.

The solution is to modify the script that handles the layer editor and to disable all the drawing overrides of the objects that belong to the layer that should get deleted.

The following video explains the problem more visually:

You can download the modified script here:

Place it in one of the user script directories that Maya will scan during startup. This way the original script stays in place (just for safety reasons) but the copy will still get evaluated after all scripts in the application folder.

I currently just modified the scripts for Maya 2011 through 2014 SP1 but if you work with a different version just let me know and I will guide you through.