IC8 Python API:RLPy RIDirectionalLight
Contents
- 1 Description
- 2 Class Methods
- 2.1 RLPy.RIDirectionalLight.GetDarkenShadowStrength(self)
- 2.2 RLPy.RIDirectionalLight.GetTransmission(self)
- 2.3 RLPy.RIDirectionalLight.IsCastShadow(self)
- 2.4 RLPy.RIDirectionalLight.SetCastShadow(self, bEnable)
- 2.5 RLPy.RIDirectionalLight.SetDarkenShadowStrength(self, kTime, fStrength)
- 2.6 RLPy.RIDirectionalLight.SetTransmission(self, b)
- Main article: iC8 Modules.
- Last modified: 01/16/2023
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