About Script

In this post, I’ll share one of my simple yet essential Maxscripts for 3ds Max users who import models and scenes from other 3D programs like MAYA or Blender.

You might encounter a situation where you want to remove an empty layer that you created earlier, but the delete option is grayed out in the layer manager. and you are unable to remove that layer. After all you have to remember that 3Ds Max never allows you to delete a layer while it contains nodes or the default layer called “0”. But in some rare situations, even an empty layer that you created and then finished with, may not be deletable in 3Ds Max. This happens because of some unclassified nodes that come with your imported models from other programs. These nodes are not visible in the viewport or the layer manager. The only way to eliminate them is to select those nodes using MaxScript and delete them manually, so the layer’s delete option becomes available again.

the main and simple function of this code is like this:

if LayerManager.current.name == "0" then messagebox "You Can NOT delete default layer. Change your Active Layer." title:"Warning"
else (
        mytitle = "Do you want to delete layer: \n\n\t" + LayerManager.current.name
        if queryBox mytitle title:"Deleting Layer" beep:on do (
            try (
                clearSelection()
                getlayer= LayerManager.getLayerFromName LayerManager.current.name
                getlayer.select on
                delete selection
                LayerManager.deleteLayerByName LayerManager.current.name
                Completeredraw()
            ) catch()
    )
)

How To

When you press the large delete button, the currently active layer in the layer manager will be deleted. And you’ll receive a notification through a query window. so press “Yes” to confirm the removal of the layer, bearing in mind that all objects on the active layer will be deleted along with it. At the same time the undo function is enabled, So there’s no need to panic. Just simply use CTRL + Z to undo the action.

For additional information, click the “INFO” link located under the delete button, and it will redirect you to the relevant details provided above.

installation

  1. Download the zip file by pressing “Download in Gumroad” button below whitch opens a float Gumroad wondow.
  2. unzip the file and drag the .mcr file to your 3Ds Max viewport.
  3. go to “Customize” menu and press “Customize User Interface”.
  4. in the toolbars tab in Category drop-down list Pick “Aslan”
  5. drag and drop “Remove Undeletable Layer” to your toolbar
  6. have fun.
8 replies
    • aslan
      aslan says:

      double checked the Link.
      but it’s looks fine here. please retry it from another browser and check it if it is work for you.
      let me know if it’s working.

      Reply
  1. GK
    GK says:

    Works like a charm, thanks!
    If the download button isnt working for you try right clicking and then ‘Save link as’.
    Sometimes your browser can block downloads he identify as a threat (which isnt the case here)

    Reply
    • Aslan
      Aslan says:

      I just update the download button with a familiar Gumroad floater download window, that way folks can even donate me (if they want) to support this type of scripts for 3Ds Max.

      Reply

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *