Editor.Model.LayerId
ClassThe 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
| Parameter | Type |
|---|---|
value | number |
Returns
LayerId
Properties
Default
staticDefault:LayerId
The default layer in a Lens.
MaxUser
staticMaxUser:LayerId
The maximum user of a layer.
MinUser
staticMinUser:LayerId
The minimum user of a layer.
Ortho
staticOrtho:LayerId
The layer which is used by the Orthographic camera by default.
Methods
forEach()
staticforEach(predicate):void
Iterates over all LayerId values, invoking the predicate for each.
Parameters
| Parameter | Type |
|---|---|
predicate | (arg1) => void |
Returns
void
forEachUser()
staticforEachUser(predicate):void
Iterates over all user-defined LayerId values, invoking the predicate for each.
Parameters
| Parameter | Type |
|---|---|
predicate | (arg1) => void |
Returns
void