Go to: Synopsis. Return value. Related. Flags. Python examples.
spotLight([barnDoors=boolean], [bottomBarnDoorAngle=angle], [coneAngle=angle], [decayRate=int], [discRadius=linear], [dropOff=float], [exclusive=boolean], [intensity=float], [leftBarnDoorAngle=angle], [name=string], [penumbra=angle], [position=[linear, linear, linear]], [rgb=[float, float, float]], [rightBarnDoorAngle=angle], [rotation=[angle, angle, angle]], [shadowColor=[float, float, float]], [shadowDither=float], [shadowSamples=int], [softShadow=boolean], [topBarnDoorAngle=angle], [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.
TlightCmd is the base class for other light commands.
TnonAmbientLightCmd is a class that looks like a command but
is not. It is a base class for the extended/nonExtended
lights.
TnonExtendedLightCmd is a base class and not a real command. It is inherited by several
lights: TpointLight, TdirectionalLight, TspotLight etc.
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.
string | Light shape name
boolean Barn door enabled state
angle Left barn door angle
angle Right barn door angle
angle Top barn door angle
angle Bottom barn door angle
angle Cone angle
angle Penumbra angle
float Dropoff 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 |
int | rate of light decay, when querying the decayRate flag |
int | Number of shadow samples, when querying the shadowSamples flag
boolean True if soft shadows are enabled, when querying the softShadow flag
float Shadow dithering value, when querying the shadowDither flag
float Disc radius value, when querying the discRadius flag |
In query mode, return type is based on queried flag.
ambientLight, directionalLight, exclusiveLightCheckBox, lightList, lightlink, pointLight, spotLightPreviewPort
barnDoors, bottomBarnDoorAngle, coneAngle, decayRate, discRadius, dropOff, exclusive, intensity, leftBarnDoorAngle, name, penumbra, position, rgb, rightBarnDoorAngle, rotation, shadowColor, shadowDither, shadowSamples, softShadow, topBarnDoorAngle, useRayTraceShadows
Long name (short name) |
Argument types |
Properties |
|
barnDoors(bd)
|
boolean
|
|
|
Are the barn doors enabled?
|
|
bottomBarnDoorAngle(bbd)
|
angle
|
|
|
Angle of the bottom of the barn door.
|
|
coneAngle(ca)
|
angle
|
|
|
decayRate(d)
|
int
|
|
|
Decay rate of the light (0-no decay, 1-slow, 2-realistic, 3-fast)
|
|
discRadius(drs)
|
linear
|
|
|
dropOff(do)
|
float
|
|
|
exclusive(exc)
|
boolean
|
|
|
True if the light is exclusively assigned
|
|
intensity(i)
|
float
|
|
|
leftBarnDoorAngle(lbd)
|
angle
|
|
|
Angle of the left of the barn door.
|
|
name(n)
|
string
|
|
|
penumbra(p)
|
angle
|
|
|
position(pos)
|
[linear, linear, linear]
|
|
|
rgb(rgb)
|
[float, float, float]
|
|
|
rightBarnDoorAngle(rbd)
|
angle
|
|
|
Angle of the right of the barn door.
|
|
rotation(rot)
|
[angle, angle, angle]
|
|
|
Rotation of the light for orientation, where applicable
|
|
shadowColor(sc)
|
[float, float, float]
|
|
|
Color of the light's shadow
|
|
shadowDither(sd)
|
float
|
|
|
shadowSamples(sh)
|
int
|
|
|
Numbr of shadow samples to use
|
|
softShadow(ss)
|
boolean
|
|
|
True if soft shadowing is to be enabled
|
|
topBarnDoorAngle(tbd)
|
angle
|
|
|
Angle of the top of the barn door.
|
|
useRayTraceShadows(rs)
|
boolean
|
|
|
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.
|
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#