Light Common Properties, Operators, and Methods

Value > MAXWrapper > Node > Light

 

   

Lights and Cameras - Quick Navigation

The following properties apply only to the 3ds Max light types: DirectionalLight, FreeSpot, OmniLight, TargetSpot and TargetDirectionalLight.

   

<light>.type Name default: #freeDirect 	 

the valid type values are:

#omni #freeSpot #targetSpot #freeDirect #targetDirect 

   

<light>.enabled Boolean default: true -- alias: on 

Turns the light on and off. When on, shading and rendering use the light to illuminate the scene. When off, the light is not used in shading or rendering.

   

<light>.excludeList Array default: #() 

Objects in this array are excluded from the effects of the light.

   

<light>.includeList Array default: undefined 

Objects in this array receive the effects of the light.

NOTE:Setting includelist or excludelist sets the other to undefined.

   

<light>.inclExclType Integer default: 3 

Select the type of object in the Include/Exclude list:

1- Illumination

2- Shadow Casting

3- Both

   

<light>.castShadows Boolean default: false 

When on, the light will cast shadows on objects.

NOTE:In 3ds Max , all node-level properties are searched before base-object-level properties. If a base-object property has the same name as a node-level property, you need to search in the base object for the base object property. You should use<light> . baseObject.castShadows instead,

FOR EXAMPLE:

$Omni01.baseObject.castShadows = false

   

<light>.rgb Color default: (color 180 180 180) -- animatable, alias: color 

The red, green, and blue components of the light's color.

   

<light>.hsv Point3 default: [0,0,180] 

Hue, Saturation, and Value color of light.

   

<light>.hue Integer default: 0 

Hue component of hsv.

   

<light>.saturation Integer default: 0 

Saturation component of hsv.

   

<light>.value Integer default: 180 

Value component of hsv.

   

<light>.multiplier Float default: 1.0 -- animatable 

Amplifies the power of the light by a positive or negative amount.

   

<light>.contrast Float default: 0.0 -- animatable 

Adjusts the contrast between the diffuse and ambient areas of the surface. Leave this set to 0 for normal contrast. Increase the value to increase the contrast for special effects: for example, the harsh light of outer space.

   

<light>.softenDiffuseEdge Float default: 0.0 -- animatable, alias: Diffuse_Soften 

Increasing the value of Soften Diffuse Edge softens the edge between the diffuse and ambient portions of a surface. This helps eliminate edges that can appear on a surface under certain circumstances.

   

<light>.affectDiffuse Boolean default: true 

When on, the light affects the diffuse properties of an object's surface. When off, the light has no effect on the diffuse surface.

   

<light>.affectSpecular Boolean default: true 

When on, the light affects the specular properties of an object's surface. When off, the light has no effect on the specular properties.

   

<light>.ambientOnly Boolean default: false 

When on, the light affects only the ambient component of the illumination.

   

<light>.projector Boolean default: false 

Turn on to project projectorMap.

   

<light>.projectorMap TextureMap default: undefined 

Assigning a TextureMap to projectorMapcauses a new subAnim named Projection_Map to be created for the light. This subAnim contains the properties of the TextureMap. You can set the property to undefined to remove the map.

NOTE:

Assigning a Projector TextureMap adds a subAnim to the properties list. The properties of the subAnim are the properties of the TextureMap.

   

<light>.useShadowProjectorMap Boolean default: false 

When on, the light will project a map.

   

<light>.nearAttenStart Float default: 0.0 -- alias: animatable, alias: Attenuation_Near_Start 

The distance at which the light begins to fade in.

   

<light>.nearAttenEndFloat default: 40.0 -- alias: animatable, alias: Attenuation_Near_End 

The distance at which the light reaches its full value.

   

<light>.useNearAtten Boolean default: false 

Enables/Disables near attenuation for the light.

   

<light>.showNearAtten Boolean default: false 

When on, displays the near attenuation range settings in viewports. For spotlights, attenuation ranges appear as lens-shaped sections of the cone. For directional lights, the ranges appear as circular sections of the cone. For omni lights and spot or directional lights with Overshoot turned on, the ranges appear as spheres.

   

<light>.farAttenStart Float default: 80.0 -- animatable, alias: Attenuation_Far_Start 

The distance at which the light begins to fade out.

   

<light>.farAttenEnd Float default: 200.0 -- animatable, alias: Attenuation_Far_End 

The distance at which the light has faded to zero.

   

<light>.useFarAtten Boolean default: false 

Enables/Disables far attenuation for the light.

   

<light>.showFarAtten Boolean default: false 

Displays the far attenuation range settings in viewports. For spotlights, attenuation ranges appear as lens-shaped sections of the cone. For directional lights, the ranges appear as circular sections of the cone. For omni lights and spot or directional lights with Overshoot turned on, the ranges appear as spheres.

   

<light>.attenDecay Integer default: 1 

The type of decay to use:

1-None (Applies no decay. The light maintains full strength from its source to infinity, unless you turn on far attenuation.)

2-Inverse (Applies inverse decay. The formula is luminance=R 0 /R, whereR 0 is the radial source of the light if no attenuation is used, or the Near End value of the light if Attenuation is used.Ris the radial distance of the illuminated surface from R 0 .)

3-Inverse Square (Applies inverse-square decay. The formula for this is (R 0 /R) 2 . This is actually the "real-world" decay of light, but you might find it too dim in the world of computer graphics.)

   

<light>.DecayRadius Float default: 40.0 -- animatable, alias: Decay_Falloff 

The distance over which the decay occurs.

   

<light>.useGlobalShadowSettings Boolean default: false 

Turn on to use global settings for shadows cast by this light. Turn off to enable individual control of the shadows.

   

<light>.raytracedShadows Boolean default: false 
NOTE:

This property should not be used in 3ds Max 5 and higher. Please use the .shadowGenerator property described below to assign a shadow generator to the light.

In versions prior to 3ds Max 5, this property controlled the raytraced shadows generator usage. When true , a raytraceShadow class instance was assigned automatically. When false ,a shadowMap class instance was assigned automatically.

   

<light>.shadowGenerator shadowMap default: shadowMap:shadowMap -- SubAnim 

The shadow generator class used by the light. Can be a shadowMap,raytraceShadow,Adv__Ray_traced or Area_Shadows class instance. See also MAXScript FAQ: How do I change the Shadow type of a Light?

EXAMPLE

--assign shadow map shadows to the light Omni01:
$Omni01.shadowGenerator = shadowMap()
-- assign ractraced shadows to light Omni02:
$Omni02.shadowGenerator = raytraceShadow()

   

<light>.ShadowColor Color default: (color 0 0 0) -- animatable, alias: Shadow_Color 

The color of shadows cast by this light.

   

<light>.shadowMultiplier Float default: 1.0 -- animatable, alias: Shadow_Density 

Controls the density of the shadow. Lower values make the shadow more transparent.

   

<light>.shadowProjectorMap TextureMap default: undefined 

Assigning a TextureMap to shadowProjectorMap causes a new subAnim named Shadow_Projection_Map to be created for the light. This subAnim contains the properties of the TextureMap. You can set the property to undefined to remove the map.

   

<light>.twoSidedShadows Boolean default: true 

When on, backfaces are not ignored when calculating shadows. Objects seen from the inside are not lit by lights from the outside. This costs a bit more render time. When off, backfaces are ignored. Rendering is quicker, but outside lights illuminate object interiors.

   

<light>.lightAffectsShadow Boolean default: false 

When on, blends the light's color with the shadow color (or shadow colors, if the shadow is mapped).

   

<light>.atmosShadows Boolean default: true 

When on, atmospheric effects cast shadows as the light passes through them.

   

<light>.atmosOpacity Float default: 100.0 -- animatable, percentage, alias: Atmosphere_Opacity 

Adjusts the opacity of the shadows. This value is a percentage.

   

<light>.atmosColorAmt Float default: 100.0 -- animatable, percentage, alias: Atmosphere_Color_Amount 

Adjusts the amount that the atmosphere's color is blended with the shadow color.

   

See Also