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

Synopsis

spotLight([coneAngle=angle], [decayRate=int], [discRadius=linear], [dropOff=float], [intensity=float], [name=string], [penumbra=angle], [rgb=[float, float, float]], [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.

spotLight is undoable, queryable, and editable.

The spotLight command is used to edit the parameters of existing spotLights, or to create new ones. The default behaviour is to create a new spotlight.

Return value

stringLight shape name

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

Related

ambientLight, directionalLight, exclusiveLightCheckBox, lightList, lightlink, pointLight, spotLightPreviewPort

Flags

coneAngle, decayRate, discRadius, dropOff, intensity, name, penumbra, rgb, shadowColor, shadowDither, shadowSamples, softShadow, useRayTraceShadows
Long name (short name) Argument types Properties
coneAngle(ca) angle createqueryedit
angle of the spotLight
decayRate(d) int createqueryedit
decay rate of the light (0-no decay, 1-slow, 2-realistic, 3-fast)
discRadius(drs) linear createqueryedit
radius of the disc around the light
dropOff(do) float createqueryedit
dropOff of the spotLight
intensity(i) float createqueryedit
intensity of the light (expressed as a percentage)
name(n) string createqueryedit
specify the name of the light
penumbra(p) angle createqueryedit
specify penumbra region
rgb(rgb) [float, float, float] createqueryedit
color of the light (0-1)
useRayTraceShadows(rs) boolean createqueryedit
ray trace shadows
shadowColor(sc) [float, float, float] createqueryedit
the shadow color
softShadow(ss) boolean createqueryedit
soft shadow
shadowSamples(sh) int createqueryedit
number of shadow samples.
shadowDither(sd) float createqueryedit
dither the shadow

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 a spot light
light = cmds.spotLight(coneAngle=45)

# Change the cone angle value
cmds.spotLight( light, e=True, coneAngle=33 )

# Query it
cmds.spotLight( light, q=True, coneAngle=True )
# Result:33#