Skip to content

Instantly share code, notes, and snippets.

@stevechap416
Last active July 18, 2019 22:24
Show Gist options
  • Save stevechap416/e6f6deffc2928dd19383ce5d41c96697 to your computer and use it in GitHub Desktop.
Save stevechap416/e6f6deffc2928dd19383ce5d41c96697 to your computer and use it in GitHub Desktop.
Maxscript: Create Layer by Name
--Creates a layer with a given name if it doesn't already exist.
function createLayer newLayerName = (
layer = LayerManager.getLayerFromName newLayerName
if layer == undefined then (
layer = LayerManager.newLayer()
layer.setname newLayerName
)
)
createLayer "My_New_Layer_Name"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment