Interface: LayerProperties

LayerProperties is a MixinInterface providing access to a specific layer's properties.

This interface is returned by some methods in the Interface: LayerManager core interface and the Interface: INodeLayerProperties node interface.

   

Interface: LayerProperties

Properties:

<LayerProperties>.on : boolean : Read|Write 	 

Get/Set the Enabled state of the layer.

   

<LayerProperties>.lock : boolean : Read|Write   

Get/Set the Locked state of the layer.

   

<LayerProperties>.current : boolean : Read|Write 

Get/Set whether the layer is the Current layer.

NOTE:

Can only be set to true !

   

<LayerProperties>.wireColor : color by value : Read|Write 

Get/Set the Wireframe Color of the layer.

   

<LayerProperties>.isGIExcluded : boolean : Read|Write 

Get/Set the Exclude from Radiosity state of the layer.

   

<LayerProperties>.name : string : Read 

Get the name of the layer. To set the name of the layer, please use the <LayerProperties>. setName() method described further on this page. This is necessary because MAXScript has to validate the new name - layer names must be unique!

   

<LayerProperties>.renderable : bool : Read|Write 

Get/Set whether the objects on the layer are renderable.

   

<LayerProperties>.inheritVisibility : bool : Read|Write 

Get/Set whether the objects on the layer inherit visibility from their parents.

   

<LayerProperties>.primaryVisibility : bool : Read|Write 

Get/Set whether the objects on the layer are visible to camera

   

<LayerProperties>.secondaryVisibility : bool : Read|Write 

Get/Set whether the objects on the layer are reflections

   

<LayerProperties>.receiveshadows : bool : Read|Write 

Get/Set whether the objects on the layer receive shadows.

   

<LayerProperties>.castShadows : bool : Read|Write 

Get/Set whether the objects on the layer cast shadows.

   

<LayerProperties>.applyAtmospherics : bool : Read|Write 

Get/Set whether the objects on the layer can be occluded by atmospheric effects

   

<LayerProperties>.renderOccluded : bool : Read|Write 

Get/Set whether the objects on the layer will render to RPF layers when occluded.

   

<LayerProperties>.ishidden : bool : Read|Write 

Get/Set whether the objects on the layer are hidden.

   

<LayerProperties>.isfrozen : bool : Read|Write 

Get/Set whether the objects on the layer are frozen.

   

<LayerProperties>.boxmode : bool : Read|Write 

Get/Set whether the objects on the layer will be displayed in box mode.

   

<LayerProperties>.backfacecull : bool : Read|Write 

Get/Set whether the objects on the layer will be displayed with culled backfaces.

   

<LayerProperties>.alledges : bool : Read|Write 

Get/Set whether the objects on the layer will be displayed with all edges visible.

   

<LayerProperties>.vertexTicks : bool : Read|Write 

Get/Set whether the objects on the layer will be displayed with vertices as ticks.

   

<LayerProperties>.showTrajectory : bool : Read|Write 

Get/Set whether the objects on the layer will show trajectories

   

<LayerProperties>.xray : bool : Read|Write 

Get/Set whether the objects on the layer will be displayed as See-Thru

   

<LayerProperties>.ignoreExtents : bool : Read|Write 

Get/Set whether the extents of the objects on the layer will be ignored.

   

<LayerProperties>.showFrozenInGray : bool : Read|Write 

Get/Set whether the objects on the layer will be displayed as gray when frozen.

   

<LayerProperties>.showVertexColors : bool : Read|Write 

Get/Set whether the objects on the layer will be displayed with vertex colors.

   

<LayerProperties>.vertexColorsShaded : bool : Read|Write 

Get/Set whether the objects on the layer will be displayed with shaded vertex colors.

   

<LayerProperties>.visibility : float : Read|Write 

Get/Set whether the objects on the layer will be visible.

   

<LayerProperties>.imageMotionBlurMultiplier : float : Read|Write 

Get/Set the Image Motion Blur Multiplier for objects on the layer

   

<LayerProperties>.motionBlurOn : bool : Read|Write 

Get/Set whether the objects on the layer will render with Motion Blur.

   

<LayerProperties>.motionblur : enum : Read|Write 

motionblur enums: {#none | #object | #image} 

Get/Set the type of Motion Blur to be used when rendering objects of the layer

   

<LayerProperties>.display : enum : Read|Write 

display enums: {#viewport | #boundingbox | #wireframe | #shaded} 

Get/Set the display mode for all objects on the layer.

   

<LayerProperties>.INodeGIProperties : Interface : Read 

The INodeGIProperties property returns a INodeGIProperties FPS interface giving access to the GI properties of the layer. See Interface: INodeGIProperties

   

<LayerProperties>.layerAsRefTarg : RefTarget : Read 

Returns the layer as a ReferenceTarget.

NOTE:

The layer system operates exactly the opposite of what you would expect - the nodes reference the layer, rather than the layers referencing the node.

EXAMPLE

s=sphere() --Create a sphere, store in variable
--> $Sphere:Sphere01 @ [0.000000,0.000000,0.000000]
sphere() --Create another one
--> $Sphere:Sphere02 @ [0.000000,0.000000,0.000000]
layer = layermanager.getlayer 0 --get default Layer 0
--> <MixinInterface:LayerProperties>
layerRT = layer.layerAsRefTarg --get layer as RefTarget
--> ReferenceTarget:BaseLayer
refs.dependents layerRT --see the dependents
--> #($Sphere:Sphere02 @ [0.0,0.0,0.0], $Sphere:Sphere01 @[0.0,0.0,0.0], ReferenceTarget:Animatable, ReferenceTarget:Animatable, ReferenceTarget:LayerManager, ReferenceTarget:Scene)
refs.dependson s
--> #(Controller:Position_Rotation_Scale, Sphere, ReferenceTarget:BaseLayer)

   

Methods:

<void>addnode <node>node 

Adds the given node to the layer. See bottom of page for an example.

   

<void>select <boolean>OnOff 

If the Boolean value is passed as true, selects all objects on the layer in the scene. If the argument is passed as false, deselects all objects on the layer.

   

<boolean>setname <string>name 

Sets the name of the layer to the given string. Returns true on success.

NOTE:

Layer names must be unique, which is why a method is used to set the layer name- it can validate the supplied name before assigning it to the layer as shown in the following example.

EXAMPLE

--First reset 3ds Max to start in an empty scene, then execute:
layer1= layermanager.getlayer 0 --get default Layer 0
--> <MixinInterface:LayerProperties>
 
layer1.setName "The One" --try to change the name
--> false --you cannot, the default layer is always called "0"
 
layer2= layermanager.getlayer 1 --try to get Layer 1
--> undefined --there is no such layer yet.
 
layer2= layermanager.newLayerFromName "Test" --let's create it
--> <MixinInterface:LayerProperties>
 
layer2.setName "Second Layer" --now we can rename it
--> true
 
layer3= layermanager.newLayerFromName "Third" -- create another
--> <MixinInterface:LayerProperties>
 
layer3.setName "Second Layer" --try to give the same name as 2nd
--> false
 
layer3.setName "ThirdLayer" --it needs a unique name to work
--> true

   

<boolean>nodes <&node array>layerNodes

layerNodes is Out parameter 

Returns True on success, and an array of all nodes on the layer in the by-reference Out parameter.

EXAMPLE

layer = layermanager.newLayerFromName "Spheres"
--> <MixinInterface:LayerProperties>
 
for i =1 to 10 do (s = sphere(); layer.addNode s)
--> OK
 
layer.nodes &theNodes
--> true
 
theNodes
--> #($Sphere:Sphere10 @ [0.000000,0.000000,0.000000], $Sphere:Sphere09 @ [0.000000,0.000000,0.000000], $Sphere:Sphere08 @ [0.000000,0.000000,0.000000], $Sphere:Sphere07 @ [0.000000,0.000000,0.000000], $Sphere:Sphere06 @ [0.000000,0.000000,0.000000], $Sphere:Sphere05 @ [0.000000,0.000000,0.000000], $Sphere:Sphere04 @ [0.000000,0.000000,0.000000], $Sphere:Sphere03 @ [0.000000,0.000000,0.000000], $Sphere:Sphere02 @ [0.000000,0.000000,0.000000], $Sphere:Sphere01 @ [0.000000,0.000000,0.000000])
 

   

<Interface>getParent()

Returns the LayerProperties MixinInterface of the layer's parent layer, or undefined if the layer has no parent.

Available in 3ds Max 2015 and higher.

   

<boolean>setParent <Interface>parent

Sets the parent of the layer to the layer represented by the specified LayerProperties MixinInterface.

Available in 3ds Max 2015 and higher.

   

<Interface>getChild <index>index

Returns the LayerProperties MixinInterface of the indexed child layer, or undefined if the indexed child layer does not exist.

Available in 3ds Max 2015 and higher.

   

<integer>getNumChildren()

Returns the number of children layers.

Available in 3ds Max 2015 and higher.

   

<bool>canDelete()

Returns True if the layer can be deleted.

Returns False if the layer cannot be deleted because it contains objects for some other reason.

Available in 3ds Max 2016 and higher.

   

<integer>getNumNodes()

Returns the number of nodes in the layer.

Available in 3ds Max 2016 and higher.

   

<bool>hasSceneXRefNodesInHierarchy()

Returns True if the layer contains Scene XRef nodes in its hierarchy.

Returns False otherwise.

Available in 3ds Max 2016 and higher.

   

See Also