Light

You can use the Light node to add a direct, point, or spot light into your script rather than using specific predefined light nodes. The light type dropdown defines which light is created and enables or disables the relevant controls in the properties panel. The node can also import lights from .fbx files using the File tab.

See also Spot, Point, Direct, Environment, and Relight.

Inputs and Controls

Connection Type

Connection Name

Function

Input

axis

An optional Axis node input. This links the position, rotation, scale, and skew of the transformed 3D object(s) to the Axis node, so that the transformation controls on the Axis node override the corresponding controls on the TransformGeo node.

If you’ve worked with other 3D applications, you may know the Axis node as a “null” or “locator” object.

look

An optional input where you can connect a Camera, Light, or Axis that the Light is automatically rotated to point toward. The Light is automatically rotated to point towards the connected input whenever the look input is moved.

 

Control (UI)

Knob (Scripting)

Default Value

Function

Light Tab

read from file

read_from_file

disabled

When disabled, the light is configured using the controls on the Light tab. Enable read from file if you want to read in light information from an .fbx file using the File tab.

light type

light_type

point

Sets the light type to point, directional, or spot and disables irrelevant controls.

color

color

1

Sets the color of the light.

intensity

intensity

1

Sets the brightness of the light.

cone angle

cone_angle

40

Sets the spot light cone angle adjusting the spread of the light. Valid angles are from 0 to 180 degrees.

Note:  This control is only enabled for spot lights.

cone penumbra angle

cone_penumbra_angle

0

Controls spot light softness along the edge of the area of illumination. A negative value fades inward from the circle's edge and vice versa. The cone falloff should be set to zero or a low amount in order to see the softness.

Note:  This control is only enabled for spot lights and does not affect the Viewer. Results are only visible on rendered objects.

cone falloff

cone_falloff

0

Sets how much the spot light diminishes from the center of the circular region out to the edge. The higher the value, the more focused the light. The falloff is independent of the falloff type

Note:  This control is only enabled for spot lights and is not affected by falloff type.

falloff type

falloff_type

No falloff

Sets the amount of light the object gets from the light source, based on the distance between the light source and the object.

No falloff - light does not diminish with distance.

Linear - diminish the light at a fixed rate as it travels from the object.

Quadratic and Cubic - diminish the light at an exponential rate.

Note:  This control is only enabled for point and spot lights.

display

display

wireframe

Adjusts the display characteristics of the 3D object. These settings don’t affect the render output of the scene; these are for display purposes only in the 3D Viewer.

off - hides the 3D geometry object.

wireframe - displays only the outlines of the object’s geometry.

solid - displays all geometry with a solid color.

solid+lines - displays the geometry as solid color with the object’s geometry outlines.

textured - displays only the surface texture.

textured+lines - displays the wireframe plus the surface texture.

selectable

selectable

enabled

When enabled, you can make selections as normal in the Viewer. When disabled, points cannot be selected or changed.

file_menu

N/A

Select to import or export a channel file:

Import chan file - import a channel file and transform the object according to the transformation data in the channel file. Channel files contain a set of Cartesian coordinates for every frame of animation in a given shot. You can create and export them using Nuke or 3D tracking software, such as 3D-Equalizer, Maya, or Boujou.

Export chan file - export the translation parameters that you’ve applied to the object as a channel file. This is a useful method of sharing setups between artists.

snap_menu

N/A

Match selection position - the object is snapped to a new position depending on the points selected.

Match selection position, orientation - the object is snapped to a new position and orientation depending on the points selected.

Match selection position, orientation, size - the object is snapped to a new position, orientation, and size depending on the points selected.

transform order

xform_order

SRT

Sets the operation order for scale (S), rotation (R), and translation (T). The possible operation combinations are SRT, STR, RST, RTS, TSR, TRS.

rotation order

rot_order

ZXY

Sets the order of rotation. The possible axial combinations are ZXY, XYZ, XZY, YXZ, YZX, ZXY, ZYX.

translate

translate

0, 0, 0

Lets you translate the object along the x, y, and z axes. You can also adjust translate values by clicking and dragging the object in the 3D Viewer.

rotate

rotate

0, 0, 0

Lets you rotate the object around the x, y, and z axes. You can adjust rotate values by holding down Ctrl/Cmd and dragging in the 3D Viewer.

scale

scaling

1, 1, 1

Lets you scale the object on the x, y, and z axes.

uniform scale

uniform_scale

1

Lets you scale the object simultaneously on the x, y, and z axes.

skew

skew

0, 0, 0

Lets you skew the object on the x, y, and z axes.

pivot

pivot

0, 0, 0

When you make changes to a 3D object’s position, scaling, skewing, and rotation, these occur from the location of the object’s origin point or pivot. The pivot x, y, and z controls allow you to offset the pivot point and move it anywhere you like - you can even move it outside of the object. Subsequent transformations applied will then occur relative to the new pivot point location.

You can also hold down Ctrl/Cmd+Alt and drag the pivot point to a new location in the 3D Viewer.

Local Matrix

specify matrix

useMatrix

N/A

Enable this control to specify matrix values for the object you’re transforming as an alternative to setting transform, scale, skew and pivot values above.

matrix

matrix

N/A

The matrix displays values from the object’s transform, rotate, scale, skew, and pivot controls.

Check specify matrix and copy or drag-and-drop matrix values from another object to apply those values, for example, if you wanted to align objects in a scene.

World Matrix

matrix

matrix

N/A

Displays the world or absolute xyz transform of the node in world coordinates.

Note:  Unlike the Local matrix, you can’t adjust the World matrix manually.

Shadows Tab

cast shadows

cast_shadows

disabled

When enabled, the light casts shadow as defined by the Shadow controls. If using a ScanlineRender node, this only applies if the light type control was set to directional or spot. Casting shadows from a point light type is not supported in the ScanlineRender node.

shadow mode

shadow_mode

solid

Presents three shadow casting modes that affect shadows cast by objects, based on the objects’ opacity:

solid - objects that cast shadows are considered to be completely solid. This option can be used with both ScanlineRender and PrmanRender.

clipped alpha - objects that cast shadows are considered to be transparent if the object’s alpha is below the light’s clipping threshold control in the Shadows tab. This option is only relevant if you are using ScanlineRender to render your shadows.

full alpha - shadows are calculated based on how light is reduced when it passes through non-opaque occluders. This option is only relevant if you are using ScanlineRender to render your shadows.

filter

filter

cubic

Determines the type of filter that the shadow mode uses when it’s set to clipped alpha or full alpha.

scene epsilon

scene_epsilon

0.001

An offset that moves the sampling point away from the geometry surface, towards the light that is casting the shadow. Increasing this value can reduce self-shadowing artifacts.

This control is only relevant if your shadows are generated using depth mapping and shadow mode is set to full alpha.

samples

samples

1

Sets the number of samples for the light when generating soft shadows. If soft shadows in your scene appear dotty or noisy, try increasing this value. The higher the value, the smoother the soft the shadows become.

This control is only relevant when shadow mode is set to solid or clipped alpha.

sample width

sample_width

1

Sets the size of the light for soft shadows. This value determines the width of the soft area around the egde of a shadow. The higher the value, the larger the soft area.

This control is only relevant if your shadows are generated using raytracing.

bias

depthmap_bias

0.01

Sets the bias for the raytracing or shadow map. Increase this value if self shadowing artifacts appear in the image. This moves the surface sample point away from surface. Note, however, that if you increase the value too much, some shadows may start moving away from the base of the objects that cast them.

This control is only relevant when shadow mode is set to solid or clipped alpha.

slope bias

depthmap_slope_bias

0.01

Bias for the shadow map. This is like bias, but the offset is proportional to the slope of the depth map. This allows you to give a different offset to each value in the depth map, depending on the surface’s slope relative to the light.

If increasing bias reduced the existing self-shadowing artifacts but introduced more artifacts in other areas of the image, you may want to bring bias down a little and increase slope bias instead.

This control is only relevant if your shadows are generated using depth mapping and shadow mode is set to solid or clipped alpha.

clipping threshold

clipping_threshold

0.5

Objects that are set to cast shadows are considered transparent if their alpha is below the value set here.

This control is only relevant if your shadows are generated using depth mapping and shadow mode is set to clipped alpha.

jitter scale

shadow_jitter_scale

3

Sets the amount of jitter used when doing percentage-closer filtering (PCF) for soft shadows. A larger jitter scale value results in softer, more perceptually accurate shadows.

PCF works by sampling the depth map at many different positions around the same spot. The final shadow value for that spot is an average of how many of the samples were occluded or visible from point of view of the light.

This control is only relevant if your shadows are generated using depth mapping and shadow mode is set to solid or clipped alpha.

depthmap resolution

depthmap_width

1024

Sets the resolution of the depth map. Larger values will result in a less crunchy edge, but will require more time to process.

Note that you can also fix crunchy edges by increasing the number of samples instead of increasing the depth map resolution.

This control is only relevant if your shadows are generated using depth mapping and shadow mode is set to solid or clipped alpha.

output mask

shadow_mask

disabled

Enables the associated channel to the right. Disabling this checkbox is the same as setting the channel to none.

none

Sets the channel you want to output the shadow map into. This can be enabled even if the cast shadows box is disabled.

File Tab (Controls on this tab are only active when read from file is enabled.)

read from file

read_from_file

disabled

When disabled, the light is configured using the controls on the Light tab. Enable read from file if you want to read in light information from an .fbx file using the File tab.

file

file

N/A

Sets the file path for the .fbx file from which you intend to import axis information.

reload

reload

N/A

Click to reload the axis information from the specified file.

animation stack name

fbx_take_name

N/A

When the file control is pointing to a valid .fbx file, select the required take name from the dropdown menu.

node name

fbx_node_name

N/A

When the file control is pointing to a valid .fbx file, select the required node name from the dropdown menu.

frame rate

frame_rate

24

When use frame rate is enabled, enter the required frame rate to use instead of the rate specified in the input file.

use frame rate

use_frame_rate

disabled

When enabled, the frame rate from the input file is ignored and the specified frame rate is used instead.

intensity scale

intensity_scale

1

Scales the intensity of the light.

Look Tab

look axis

look_axis

-Z

The axis around which the Light is rotated to face the look input.

rotate X

look_rotate_x

enabled

Determines whether the rotation occurs around the X axis. Note that for the rotation to truly "look at" the look input, all three of these options must be activated.

rotate Y

look_rotate_y

enabled

Determines whether the rotation occurs around the Y axis. Note that for the rotation to truly "look at" the look input, you have to set all three of these options.

rotate Z

look_rotate_z

enabled

Determines whether the rotation occurs around the Z axis. Note that for the rotation to truly "look at" the look input, you have to set all three of these options.

look strength

look_strength

1

Determines to what extent the Light rotates to the new orientation. The smaller the value, the less the object is rotated. Setting the value to 0 produces no rotation.

use quaternions

look_use_quaternions

disabled

Uses an alternate scheme to calculate the look rotation. This option may be useful to smooth out erratic rotations along the look axis.

Step-by-Step Guides

Inserting Direct Lights, Point Lights, or Spot Lights

Video Tutorials

Related Topics Link IconRelated Topics