pymel.core.rendering.spotLight

spotLight(*args, **kwargs)

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.

Maya Bug Fix:
  • name flag was ignored
Flags:
Long name (short name) Argument Types Properties
barnDoors (bd) bool ../../../_images/query.gif ../../../_images/edit.gif
   
bottomBarnDoorAngle (bbd) float ../../../_images/query.gif ../../../_images/edit.gif
   
coneAngle (ca) float ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
angle of the spotLight
decayRate (d) int ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
decay rate of the light (0-no decay, 1-slow, 2-realistic, 3-fast)
discRadius (drs) float ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
radius of the disc around the light
dropOff (do) float ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
dropOff of the spotLight
exclusive (exc) bool ../../../_images/query.gif ../../../_images/edit.gif
   
intensity (i) float ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
intensity of the light (expressed as a percentage)
leftBarnDoorAngle (lbd) float ../../../_images/query.gif ../../../_images/edit.gif
   
name (n) unicode ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
specify the name of the light
penumbra (p) float ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
specify penumbra region
position (pos) float, float, float ../../../_images/query.gif ../../../_images/edit.gif
   
rgb (rgb) float, float, float ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
color of the light (0-1)
rightBarnDoorAngle (rbd) float ../../../_images/query.gif ../../../_images/edit.gif
   
rotation (rot) float, float, float ../../../_images/query.gif ../../../_images/edit.gif
   
shadowColor (sc) float, float, float ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
the shadow color
shadowDither (sd) float ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
dither the shadowFlag can appear in Create mode of commandFlag can have multiple arguments, passed either as a tuple or a list.
shadowSamples (sh) int ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
number of shadow samples.
softShadow (ss) bool ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
soft shadow
topBarnDoorAngle (tbd) float ../../../_images/query.gif ../../../_images/edit.gif
   
useRayTraceShadows (rs) bool ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
ray trace shadows

Derived from mel command maya.cmds.spotLight

Example:

import pymel.core as pm

import maya.cmds as cmds

# Create a spot light
light = pm.spotLight(coneAngle=45)

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

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