pymel.core.rendering.directionalLight¶
- directionalLight(*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. TnonExtendedLightCmd is a base class and not a real command. It is inherited by several lights: TpointLight, TdirectionalLight, TspotLight etc. 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. This is the commmand that instantiates an directionalLight or edits the parameters of an existing one. TdirectionalLightCmd inherits from TnonExtendedLightCmd which defines softShadow flags. See TlightCmd for a global picture of the light commands. TdirectionalLightCmd behaves like any other command, it has flags, saves undo information etc. the only slightly different behaviour is that it calls up to TnonExtendedLightCmd to complete the functionality of the command.
- Maya Bug Fix:
- name flag was ignored
Flags:
Long Name / Short Name Argument Types Properties decayRate / d int Decay rate of the light (0-no decay, 1-slow, 2-realistic, 3-fast) discRadius / drs float Radius of shadow disc. exclusive / exc bool True if the light is exclusively assigned intensity / i float Intensity of the light name / n unicode Name of the light position / pos float, float, float Position of the light rgb / rgb float, float, float RGB colour of the light rotation / rot float, float, float Rotation of the light for orientation, where applicable shadowColor / sc float, float, float Color of the light’s shadow shadowDither / sd float Shadow dithering value. shadowSamples / sh int Numbr of shadow samples to use softShadow / ss bool True if soft shadowing is to be enabled useRayTraceShadows / rs bool 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.directionalLight
Example:
import pymel.core as pm # 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#