Type: “mp.directionalLight”

Inputs

Property Description
enabled: boolean
default true
If true the directional light is active in the scene.
color: { r: number, g: number : b number }
default { r: 1.0, g: 1.0, b: 1.0 }
The color of the light.
Each color component is a number between 0 and 1.
intensity: number
default 2
The light intensity.
position: { x: number, y: number, z: number }
default { x: 1, y: 5, z: 1 }
The world space position of the directional light.
target: { x: number, y: number, z: number }
default { x: 0, y: 0, z: 0 }
The directional light’s world space target position.
debug: boolean
default false
Enables debugging visuals.
var [ sceneObject ] = await sdk.Scene.createObjects(1);
var node = sceneObject.addNode();
var initial = {
  enabled: false,
  color: {
    r: 0, g: 1, b: 0
  },
  intensity: 0.8,
  position: {
    x: 0, y: 1, z: 0
  },
  target: {
    x: 0, y: 0, z: 0
  },
  debug: false,
};

node.addComponent('mp.directionalLight', initial);
node.start();