IC8 Python API:RLPy RIDirectionalLight

From Reallusion Wiki!
Jump to: navigation, search
Main article: iC8 Modules.
Last modified: 10/21/2026

Description

This class provides operations for Directional Lights, e.g. whether or not to cast shadows, the light's color, light strength, etc. You must first retrieve a directional light from the scene in order to use these operations.

Class Methods

RLPy.RIDirectionalLight.GetDarkenShadowStrength(self)

Get the light darken shadow strength.

Experimental API

Returns

The value of the "shadow strength" attribute of the light node - float

1 light_object = RLPy.RScene.FindObject(RLPy.EObjectType_Light, "Dir. Light")
2 
3 if light_object:
4   result = light_object.SetDarkenShadowStrength(RLPy.RGlobal.GetTime(), 50)
5   print(light_object.GetDarkenShadowStrength())

RLPy.RIDirectionalLight.GetTransmission(self)

Get if light transmits through SSS (subsurface scattering) material.

Experimental API

Returns

True if light transmits, False if it doesn't - bool

1 # No example

RLPy.RIDirectionalLight.IsCastShadow(self)

Get the light if cast shadow enable.

Experimental API

Returns

True if light is cast shadow enable, False if not - bool

1 light_object = RLPy.RScene.FindObject(RLPy.EObjectType_Light, "Dir. Light")
2 
3 if light_object:
4     light_object.SetCastShadow(True)
5     print(light_object.IsCastShadow())
6 
7     light_object.SetCastShadow(False)
8     print(light_object.IsCastShadow())

RLPy.RIDirectionalLight.SetCastShadow(self, bEnable)

Set the light's cast shadow is enable.

Experimental API

Parameters

bEnable[in] If light's cast shadow is enable - bool

Returns

RLPy.RStatus.Success - Succeed
RLPy.RStatus.Failure - Fail
1 light_object = RLPy.RScene.FindObject(RLPy.EObjectType_Light, "Dir. Light")
2 
3 if light_object:
4     light_object.SetCastShadow(True)
5     light_object.SetCastShadow(False)

RLPy.RIDirectionalLight.SetDarkenShadowStrength(self, kTime, fStrength)

Set the light's shadow strength.

Experimental API

Parameters

fStrength[in] The Light shadow strength value - float

Returns

RLPy.RStatus.Success - Succeed
RLPy.RStatus.Failure - Fail
1 light_object = RLPy.RScene.FindObject(RLPy.EObjectType_Light, "Dir. Light")
2 
3 if light_object:
4   result = light_object.SetDarkenShadowStrength(RLPy.RGlobal.GetTime(), 50)
5   print(result)

RLPy.RIDirectionalLight.SetTransmission(self, b)

Set light to transmit through SSS (subsurfarce scattering) material.

Experimental API

Parameters

b[in] If light transmits through SSS matreial - bool

Returns

RLPy.RStatus.Success - Succeed
RLPy.RStatus.Failure - Fail
1 # No example

Description

This class provides operations for Directional Lights, e.g. whether or not to cast shadows, the light's color, light strength, etc. You must first retrieve a directional light from the scene in order to use these operations.

Constructor & Destructor

__init__ (self, *args, **kwargs)

Initializes a new ri directional light instance.

Parameters

  • args
  • kwargs

Member Functions

GetDarkenShadowStrength (self)

Get the directional light's shadow strength at a given point in time (0 to 100).

GetTransmission (self)

Returns the transmission.

IsCastShadow (self)

Check whether or not the light is casting shadows.

SetCastShadow (self, bEnable)

Turn on or off the directional light's cast shadow.

Parameters

  • bEnable

SetDarkenShadowStrength (self, kTime, fStrength)

Set the directional light's shadow strength at a given point in time (0 to 100).

Parameters

  • kTime
  • fStrength

SetTransmission (self, b)

Sets the transmission.

Parameters

  • b

Properties

thisown

Indicates whether this SWIG proxy owns the underlying C++ object.