Used to describe a set of layers that an object belongs to or interacts with.
See SceneObject's layer property, Camera's renderLayer property, and LightSource's renderLayer property.
layer
renderLayer
Check if a Camera will render this SceneObject
// @input Component.Camera camera// Check if the camera will render this SceneObjectvar cameraLayer = script.camera.renderLayer;var objectLayer = script.getSceneObject().layer;var intersection = cameraLayer.intersect(objectLayer);if (intersection.isEmpty()) { print("camera won't render this object");} else { print("camera will render this object");} Copy
// @input Component.Camera camera// Check if the camera will render this SceneObjectvar cameraLayer = script.camera.renderLayer;var objectLayer = script.getSceneObject().layer;var intersection = cameraLayer.intersect(objectLayer);if (intersection.isEmpty()) { print("camera won't render this object");} else { print("camera will render this object");}
Add this SceneObject's layer to a Camera's render layer, so that the camera will render it.
// @input Component.Camera camera// Add this SceneObject's layer to a Camera's render layervar objectLayer = script.getSceneObject().layer;script.camera.renderLayer = script.camera.renderLayer.union(objectLayer); Copy
// @input Component.Camera camera// Add this SceneObject's layer to a Camera's render layervar objectLayer = script.getSceneObject().layer;script.camera.renderLayer = script.camera.renderLayer.union(objectLayer);
Create a new LayerSet based on a number
// Create a LayerSet based on 0var layerSet = LayerSet.fromNumber(0); Copy
// Create a LayerSet based on 0var layerSet = LayerSet.fromNumber(0);
Returns true if all layers in the other LayerSet are also present in this one.
other
Returns a new LayerSet that contains layers present in this LayerSet but not present in other.
Returns a new LayerSet that only contains layers present in both this LayerSet and other.
Returns true if this LayerSet contains no layers.
Returns a string representation of this LayerSet.
Returns a new LayerSet combining this LayerSet and other.
Used to describe a set of layers that an object belongs to or interacts with.
See SceneObject's
layer
property, Camera'srenderLayer
property, and LightSource'srenderLayer
property.Example
Check if a Camera will render this SceneObject
Add this SceneObject's layer to a Camera's render layer, so that the camera will render it.
Create a new LayerSet based on a number