pymel.core.rendering.spotLight

spotLight(*args, **kwargs)

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. This is abstract 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.

Maya Bug Fix:
  • name flag was ignored

Flags:

Long Name / Short Name Argument Types Properties
barnDoors / bd bool ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
  Are the barn doors enabled?
bottomBarnDoorAngle / bbd float ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
  Angle of the bottom of the barn door.
coneAngle / ca float ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
  angle of the spotLight
decayRate / d int ../../../_images/create.gif
  Decay rate of the light (0-no decay, 1-slow, 2-realistic, 3-fast)
discRadius / drs float ../../../_images/create.gif ../../../_images/query.gif
  Radius of shadow disc.
dropOff / do float ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
  dropOff of the spotLight
exclusive / exc bool ../../../_images/create.gif ../../../_images/query.gif
  True if the light is exclusively assigned
intensity / i float ../../../_images/create.gif ../../../_images/query.gif
  Intensity of the light
leftBarnDoorAngle / lbd float ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
  Angle of the left of the barn door.
name / n unicode ../../../_images/create.gif ../../../_images/query.gif
  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/create.gif ../../../_images/query.gif
  Position of the light
rgb / rgb float, float, float ../../../_images/create.gif ../../../_images/query.gif
  RGB colour of the light
rightBarnDoorAngle / rbd float ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
  Angle of the right of the barn door.
rotation / rot float, float, float ../../../_images/create.gif ../../../_images/query.gif
  Rotation of the light for orientation, where applicable
shadowColor / sc float, float, float ../../../_images/create.gif ../../../_images/query.gif
  Color of the light’s shadow
shadowDither / sd float ../../../_images/create.gif ../../../_images/query.gif
  Shadow dithering value.
shadowSamples / sh int ../../../_images/create.gif ../../../_images/query.gif
  Numbr of shadow samples to use
softShadow / ss bool ../../../_images/create.gif ../../../_images/query.gif
  True if soft shadowing is to be enabled
topBarnDoorAngle / tbd float ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
  Angle of the top of the barn door.
useRayTraceShadows / rs bool ../../../_images/create.gif ../../../_images/query.gif
  True if ray trace shadows are to be used Flag can have multiple arguments, passed either as a tuple or a list.

Derived from mel command maya.cmds.spotLight

Example:

import pymel.core as pm

# 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#