Go to: Synopsis. Return value. Related. Flags. Python examples.

Synopsis

ambientLight([ambientShade=float], [discRadius=linear], [exclusive=boolean], [intensity=float], [name=string], [position=[linear, linear, linear]], [rgb=[float, float, float]], [rotation=[angle, angle, angle]], [shadowColor=[float, float, float]], [shadowDither=float], [shadowSamples=int], [softShadow=boolean], [useRayTraceShadows=boolean])

Note: Strings representing object names and arguments must be separated by commas. This is not depicted in the synopsis.

ambientLight is undoable, queryable, and editable.

TlightCmd is the base class for other light commands. The ambientLight command is used to edit the parameters of existing ambientLights, or to create new ones. The default behaviour is to create a new ambientlight.

This is the commmand that instantiates an ambientLight or edits the parameters of an existing one. TambientLightCmd inherits from TlightCmd which defines common flags like intensity, colour etc. See TlightCmd for a global picture of the light commands. Note that the flag fAmbientLightUsed indicates whether the command uses any ambient specific flags. That is, if a command doesn't use flags defined here, the boolean fAmbientLightUsed is set to false and thus the undo/redo information is not saved at this level.

TambientLightCmd behaves like any other command, it has flags, saves undo information etc. the only slightly different behaviour is that it calls up to TlightCmd to complete the functionality of the command. Example parseArgs: TambientLightCmd defines ambientLight specific parameters like -ambientShade however, several other parameters are available in TlightCmd such as -intensity etc. So when parsing the arguments, a call is made to TlightCmd::parseArgs to parse common parameters (like Intensity).

Return value

double[]when querying the rgb or shadowColor flags double when querying the intensity flag boolean when querying the useRayTraceShadows or exclusive flags linear[] when querying the position flag angle[] when querying the rotation flag string when querying the name flag
stringLight shape name

In query mode, return type is based on queried flag.

Related

directionalLight, exclusiveLightCheckBox, lightList, lightlink, pointLight, spotLight, spotLightPreviewPort

Flags

ambientShade, discRadius, exclusive, intensity, name, position, rgb, rotation, shadowColor, shadowDither, shadowSamples, softShadow, useRayTraceShadows
Long name (short name) Argument types Properties
ambientShade(ambientShade) float createqueryedit
ambientShade
discRadius(drs) linear createqueryedit
radius of the disc around the light
exclusive(exc) boolean createquery
True if the light is exclusively assigned
intensity(i) float createquery
Intensity of the light
name(n) string createquery
Name of the light
position(pos) [linear, linear, linear] createquery
Position of the light
rgb(rgb) [float, float, float] createquery
RGB colour of the light
rotation(rot) [angle, angle, angle] createquery
Rotation of the light for orientation, where applicable
shadowColor(sc) [float, float, float] createquery
Color of the light's shadow
shadowDither(sd) float createqueryedit
dither the shadow
shadowSamples(sh) int createqueryedit
number of shadow samples.
softShadow(ss) boolean createqueryedit
soft shadow
useRayTraceShadows(rs) boolean createquery
True if ray trace shadows are to be used

Flag can appear in Create mode of command Flag can appear in Edit mode of command
Flag can appear in Query mode of command Flag can have multiple arguments, passed either as a tuple or a list.

Python examples

import maya.cmds as cmds

# Create an ambientLight light
light = cmds.ambientLight(intensity=0.8)

# Change the light intensity
cmds.ambientLight( light, e=True, intensity=0.5 )

# Query it
cmds.ambientLight( light, q=True, intensity=True )
# Result:0.5 #