Skip to main content

Editor.Model.LayerId

Class

The id of a Editor.Model.Layer.

Index

Example

// LayerId identifies a scene Layer. Scene objects and cameras belong to
// LayerSets built from these ids — a camera only renders objects whose
// layer set intersects its renderLayer.
const model = this.pluginSystem.findInterface(Editor.Model.IModel) as Editor.Model.IModel;
const scene = model.project.scene;

// Put a new scene object on the Default layer and render it via a camera
// constrained to that same layer.
const obj = scene.createSceneObject('DefaultLayerObj');
obj.layers = Editor.Model.LayerSet.fromId(Editor.Model.LayerId.Default);

const camObj = scene.createSceneObject('DefaultCam');
const camera = camObj.addComponent('Camera') as Editor.Components.Camera;
camera.renderLayer = Editor.Model.LayerSet.fromId(Editor.Model.LayerId.Default);

console.log(`Object and camera both assigned the Default LayerId so the camera will render the object.`);

Constructors

Constructor

new LayerId(value): LayerId

Constructs a new LayerId instance.

Parameters

ParameterType
valuenumber

Returns

LayerId

Properties

Default

static Default: LayerId

The default layer in a Lens.


MaxUser

static MaxUser: LayerId

The maximum user of a layer.


MinUser

static MinUser: LayerId

The minimum user of a layer.


Ortho

static Ortho: LayerId

The layer which is used by the Orthographic camera by default.

Methods

forEach()

static forEach(predicate): void

Iterates over all LayerId values, invoking the predicate for each.

Parameters

ParameterType
predicate(arg1) => void

Returns

void


forEachUser()

static forEachUser(predicate): void

Iterates over all user-defined LayerId values, invoking the predicate for each.

Parameters

ParameterType
predicate(arg1) => void

Returns

void