The directionalLight command is used to edit the parameters of existing directionalLights, or to create new ones. The default behaviour is to create a new directionallight.
| Long name (short name) | Argument Types | Properties | |
|---|---|---|---|
| decayRate (d) | int |
|
|
|
|||
| discRadius (drs) | float |
|
|
|
|||
| exclusive (exc) | bool |
|
|
| intensity (i) | float |
|
|
|
|||
| name (n) | unicode |
|
|
|
|||
| position (pos) | float, float, float |
|
|
| rgb (rgb) | float, float, float |
|
|
|
|||
| rotation (rot) | float, float, float |
|
|
| shadowColor (sc) | float, float, float |
|
|
|
|||
| shadowDither (sd) | float |
|
|
|
|||
| shadowSamples (sh) | int |
|
|
|
|||
| softShadow (ss) | bool |
|
|
|
|||
| useRayTraceShadows (rs) | bool |
|
|
|
|||
Derived from mel command maya.cmds.directionalLight
Example:
import pymel.core as pm
import maya.cmds as cmds
# Create a directional light
light = pm.directionalLight(rotation=(45, 30, 15))
# Change the light intensity
pm.directionalLight( light, e=True, intensity=0.5 )
# Query it
pm.directionalLight( light, q=True, intensity=True )
# Result: 0.5 #
# Result:0.5#