Skip to content
the poor coder

maxscript create new Layer

Poor Man
Published
Reading time
1 min read
On this page

Maxscript Create New Layer#

Creating new layers in Maxscript is a fairly straightforward process. Layers in 3D graphics software are like folders that help organize objects and groups of objects. These layers can be created and manipulated through the use of Maxscript. Here are a few ways to create new layers in Maxscript:

Method 1: Using the Layer Manager#

MAXSCRIPT

layerManager = maxOps.getLayerManager()
newLayer = layerManager.createLayer "myNewLayer"

In this method, we first get the layer manager object using maxOps.getLayerManager(). We then use the createLayer method to create a new layer with the name "myNewLayer".

Method 2: Using the Layer Interface#

MAXSCRIPT

newLayer = LayerManager.newLayer()
newLayer.name = "myNewLayer"

In this method, we create a new layer object using LayerManager.newLayer(). We then set the layer's name using the name property.

Method 3: Using the Layer Manager and Array#

MAXSCRIPT

newLayer = LayerManager.newLayer()
newLayer.name = "myNewLayer"
layerManager.current = #{newLayer}

This method is similar to Method 2, but we also set the current layer to our new layer object. This means that any objects we create after this point will be automatically assigned to our new layer.

These are just a few of the ways to create new layers in Maxscript. Depending on your specific needs and workflow, you may find one method more useful than the others.

Keep going

2023

how to sort an array

How to Sort an Array If you have an array and you want to order its elements in a specific way, you need to use a sorting algorithm. There are several sorting algorithms available, but two of the most commonly used are…

javascript2 min read
2023

jquery mobile or desktop

jQuery Mobile or Desktop? As a web developer, I have had some experience with both jQuery Mobile and jQuery Desktop. Both frameworks have their pros and cons, and which one to use really depends on the specific project…

javascript1 min read
2023

node.js folder structure

Node.js Folder Structure If you are new to Node.js, it can be daunting to create a folder structure that will work for your project. The structure you choose will depend on the size and complexity of your project. Here…

javascript1 min read
ESC