IC8 Python API:RLPy RISpotLight
Contents
- 1 Description
- 2 Class Methods
- 2.1 RLPy.RISpotLight.ClearRectTexture(self)
- 2.2 RLPy.RISpotLight.GetDarkenShadowStrength(self)
- 2.3 RLPy.RISpotLight.GetInverseSquare(self)
- 2.4 RLPy.RISpotLight.GetRange(self)
- 2.5 RLPy.RISpotLight.GetRectWidthHeight(self)
- 2.6 RLPy.RISpotLight.GetSpotLightBeam(self, nAngle, nFalloff, nAttenuation)
- 2.7 RLPy.RISpotLight.GetTransmission(self)
- 2.8 RLPy.RISpotLight.GetTubeLength(self)
- 2.9 RLPy.RISpotLight.GetTubeRadius(self)
- 2.10 RLPy.RISpotLight.GetTubeSoftRadius(self)
- 2.11 RLPy.RISpotLight.IsCastShadow(self)
- 2.12 RLPy.RISpotLight.IsRectangleShape(self)
- 2.13 RLPy.RISpotLight.IsTubeShape(self)
- 2.14 RLPy.RISpotLight.LoadIes(self, strIesFilePath)
- 2.15 RLPy.RISpotLight.LoadRectTexture(self, strTexturePath)
- 2.16 RLPy.RISpotLight.SaveIes(self, strIesFilePath)
- 2.17 RLPy.RISpotLight.SaveRectTexture(self, strTexturePath)
- 2.18 RLPy.RISpotLight.SetCastShadow(self, bEnable)
- 2.19 RLPy.RISpotLight.SetDarkenShadowStrength(self, kTime, fStrength)
- 2.20 RLPy.RISpotLight.SetInverseSquare(self, b)
- 2.21 RLPy.RISpotLight.SetRange(self, kTime, fRange)
- 2.22 RLPy.RISpotLight.SetRectangleShape(self, bRectangle)
- 2.23 RLPy.RISpotLight.SetRectWidthHeight(self, vWidthHeight)
- 2.24 RLPy.RISpotLight.SetSpotLightBeam(self, kTime, fAngle, fFalloff, fAttenuation)
- 2.25 RLPy.RISpotLight.SetTransmission(self, b)
- 2.26 RLPy.RISpotLight.SetTubeLength(self, fLength)
- 2.27 RLPy.RISpotLight.SetTubeRadius(self, radius)
- 2.28 RLPy.RISpotLight.SetTubeShape(self, bTube)
- 2.29 RLPy.RISpotLight.SetTubeSoftRadius(self, softRadius)
- 3 Description
- 4 Constructor & Destructor
- 5 Member Functions
- 5.1 ClearRectTexture (self)
- 5.2 GetDarkenShadowStrength (self)
- 5.3 GetInverseSquare (self)
- 5.4 GetRange (self)
- 5.5 GetRectWidthHeight (self)
- 5.6 GetSpotLightBeam (self, fAngle, fFalloff, fAttenuation)
- 5.7 GetTransmission (self)
- 5.8 GetTubeLength (self)
- 5.9 GetTubeRadius (self)
- 5.10 GetTubeSoftRadius (self)
- 5.11 IsCastShadow (self)
- 5.12 IsRectangleShape (self)
- 5.13 IsTubeShape (self)
- 5.14 LoadIes (self, strIesFilePath)
- 5.15 LoadRectTexture (self, strTexturePath)
- 5.16 SaveIes (self, strIesFilePath)
- 5.17 SaveRectTexture (self, strTexturePath)
- 5.18 SetCastShadow (self, bEnable)
- 5.19 SetDarkenShadowStrength (self, kTime, fStrength)
- 5.20 SetInverseSquare (self, b)
- 5.21 SetRange (self, kTime, fRange)
- 5.22 SetRectWidthHeight (self, vWidthHeight)
- 5.23 SetRectangleShape (self, bRectangle)
- 5.24 SetSpotLightBeam (self, kTime, fAngle, fFalloff, fAttenuation)
- 5.25 SetTransmission (self, b)
- 5.26 SetTubeLength (self, fLength)
- 5.27 SetTubeRadius (self, radius)
- 5.28 SetTubeShape (self, bTube)
- 5.29 SetTubeSoftRadius (self, softRadius)
- 6 Properties
- Main article: iC8 Modules.
- Last modified: 10/21/2026
Description
This class provides spotlight related operations, i.e. whether or not to cast shadows, light color, light ray direction, light strength, etc.
Class Methods
RLPy.RISpotLight.ClearRectTexture(self)
Clear rectangle texture of this light.
Experimental API
Returns
- RLPy.RStatus.Success - Succeed
- RLPy.RStatus.Failure - Fail
1 # No example
RLPy.RISpotLight.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, "Spotlight") # Find the spotlight by name
2
3 #get light shadow strength
4 print(light_object.GetDarkenShadowStrength())
RLPy.RISpotLight.GetInverseSquare(self)
Get if light's intensity follows inverse-square law in physics.
Experimental API
Returns
True if light's intensity follows inverse-square law, False if it is not - bool
1 # No example
RLPy.RISpotLight.GetRange(self)
Get the light range.
Experimental API
Returns
The value of the "range" attribute of the light node - float
1 light_object = RLPy.RScene.FindObject(RLPy.EObjectType_Light, "Spotlight") # Find the spotlight by name
2
3 #get light range
4 print(light_object.GetRange())
RLPy.RISpotLight.GetRectWidthHeight(self)
Get the light's rectangle's width & height.
Experimental API
Returns
rectangle's width & height - RLPy.RVector2f
Parameters
- kTime[in] The time at which to set the multiplier.
- fMultiplier[in] The Light multiplier value.
Returns
- RLPy.RStatus.Success - Succeed
- RLPy.RStatus.Failure - Fail
1 # No example
RLPy.RISpotLight.GetSpotLightBeam(self, nAngle, nFalloff, nAttenuation)
Get the spot light beam parameters.
Experimental API
Parameters
nAngle[out] Get the Light angle value - int nFalloff[out] Get the Light falloff value - int nAttenuation[out] Get the Light attenuation value - int
Returns
- RLPy.RStatus.Success - Succeed
- RLPy.RStatus.Failure - Fail
1 # Find the spotlight by name
2 light_object = RLPy.RScene.FindObject(RLPy.EObjectType_Light, "Spotlight")
3
4 # Set light beam
5 light_object.SetSpotLightBeam(RLPy.RTime(0), 90, 50, 2)
6
7 # Get light beam
8 angle = 0
9 falloff = 0
10 attenuation = 0
11 status, angle, falloff, attenuation = light_object.GetSpotLightBeam(angle, falloff, attenuation)
12
13 print(status.IsError()) # False
14 print(angle) # 90
15 print(falloff) # 50
16 print(attenuation) # 2
RLPy.RISpotLight.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.RISpotLight.GetTubeLength(self)
Get the light's tube length.
Experimental API
Returns
light's tube length - float
1 # No example
RLPy.RISpotLight.GetTubeRadius(self)
Get the light's tube Radius.
Experimental API
Returns
light's tube Radius - float
1 # No example
RLPy.RISpotLight.GetTubeSoftRadius(self)
Get the light's tube SoftRadius.
Experimental API
Returns
light's tube SoftRadius - float
1 # No example
RLPy.RISpotLight.IsCastShadow(self)
Get the light if cast shadow enable.
Experimental API
Returns
True if light is cast shadow enable, False if not - bool
1 # Find the spotlight by name
2 light_object = RLPy.RScene.FindObject(RLPy.EObjectType_Light, "Spotlight")
3 print(light_object.IsCastShadow())
RLPy.RISpotLight.IsRectangleShape(self)
Get if light's shape is a rectangle.
Experimental API
Returns
True if light's shape is a rectangle, False if it is not - bool
1 # No example
RLPy.RISpotLight.IsTubeShape(self)
Get if light's shape is a tube, sphere is also considered a tube with zero length.
Experimental API
Returns
True if light's shape is a tube, False if it is not - bool
1 # No example
RLPy.RISpotLight.LoadIes(self, strIesFilePath)
Load an IES file for this light.
Experimental API
Parameters
- strIesFilePath[in] The IES file path you want to load - string
Returns
- RLPy.RStatus.Success - Succeed
- RLPy.RStatus.Failure - Fail
1 # No example
RLPy.RISpotLight.LoadRectTexture(self, strTexturePath)
Load a rectangle texture for this light.
Experimental API
Parameters
- strTexturePath[in] The texture path you want to load - string
Returns
- RLPy.RStatus.Success - Succeed
- RLPy.RStatus.Failure - Fail
1 # No example
RLPy.RISpotLight.SaveIes(self, strIesFilePath)
Save the IES file of this light.
Experimental API
Parameters
- strIesFilePath[in] The IES file path you want to save - string
Returns
- RLPy.RStatus.Success - Succeed
- RLPy.RStatus.Failure - Fail
1 # No example
RLPy.RISpotLight.SaveRectTexture(self, strTexturePath)
Save the rectangle texture of this light.
Experimental API
Parameters
- strTexturePath[in] The texture path you want to save - string
Returns
- RLPy.RStatus.Success - Succeed
- RLPy.RStatus.Failure - Fail
1 # No example
RLPy.RISpotLight.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 # Find the spotlight by name
2 light_object = RLPy.RScene.FindObject(RLPy.EObjectType_Light, "Spotlight")
3 light_object.SetCastShadow(True)
4 print(light_object.IsCastShadow())
RLPy.RISpotLight.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 # Find the spotlight by name
2 light_object = RLPy.RScene.FindObject(RLPy.EObjectType_Light, "Spotlight")
3
4 # Set light shadow strength
5 light_object.SetDarkenShadowStrength(RLPy.RTime(0), 50.0)
RLPy.RISpotLight.SetInverseSquare(self, b)
Set light's intensity to follow inverse-square law in physics.
Experimental API
Parameters
- b[in] If light's intensity follows inverse-square law - bool
Returns
- RLPy.RStatus.Success - Succeed
- RLPy.RStatus.Failure - Fail
1 # No example
RLPy.RISpotLight.SetRange(self, kTime, fRange)
Set the light range.
Experimental API
Parameters
- kTime[in] The time at which to set the beam - RLPy.RLTime
- fRange[in] The Light range value - float
Returns
- RLPy.RStatus.Success - Succeed
- RLPy.RStatus.Failure - Fail
1 # Find the spotlight by name
2 light_object = RLPy.RScene.FindObject(RLPy.EObjectType_Light, "Spotlight")
3
4 # Set light range
5 light_object.SetRange(RLPy.RTime(0), 1000.0)
6 print(light_object.GetRange())
RLPy.RISpotLight.SetRectangleShape(self, bRectangle)
Set the light's shape to rectangle.
Experimental API
Parameters
- bRectangle[in] If light's shape is a rectangle - bool
Returns
- RLPy.RStatus.Success - Succeed
- RLPy.RStatus.Failure - Fail
1 # No example
RLPy.RISpotLight.SetRectWidthHeight(self, vWidthHeight)
Set the light's rectangle's width & height.
Experimental API
Parameters
- vWidthHeight[in] rectangle's width & height - RLPy.RVector2f
Returns
- RLPy.RStatus.Success - Succeed
- RLPy.RStatus.Failure - Fail
1 # No example
RLPy.RISpotLight.SetSpotLightBeam(self, kTime, fAngle, fFalloff, fAttenuation)
Set the spot light beam parameters.
Experimental API
Parameters
- kTime[in] The time at which to set the beam - RLPy.RLTime
- fAngle[in] The Light angle value - float
- fFalloff[in] The Light falloff value - float
- fAttenuation[in] The Light attenuation value - float
Returns
- RLPy.RStatus.Success - Succeed
- RLPy.RStatus.Failure - Fail
1 # use light name to find object
2 light_object = RLPy.RScene.FindObject(RLPy.EObjectType_Light, "Spotlight")
3
4 # set light beam
5 angle = 135.0
6 falloff_power = 40.0
7 attenuation = 2
8 light_object.SetSpotLightBeam(RLPy.RTime(0), angle, falloff_power, attenuation)
RLPy.RISpotLight.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
RLPy.RISpotLight.SetTubeLength(self, fLength)
Set the light's tube length.
Experimental API
Parameters
- fLength[in] tube length - float
Returns
- RLPy.RStatus.Success - Succeed
- RLPy.RStatus.Failure - Fail
1 # No example
RLPy.RISpotLight.SetTubeRadius(self, radius)
Set the light's tube radius.
Experimental API
Parameters
- radius[in] tube radius - float
Returns
- RLPy.RStatus.Success - Succeed
- RLPy.RStatus.Failure - Fail
1 # No example
RLPy.RISpotLight.SetTubeShape(self, bTube)
Set the light's shape to tube, sphere is also considered a tube with zero length.
Experimental API
Parameters
- bTube[in] If light's shape is a tube - bool
Returns
- RLPy.RStatus.Success - Succeed
- RLPy.RStatus.Failure - Fail
1 # No example
RLPy.RISpotLight.SetTubeSoftRadius(self, softRadius)
Set the light's tube soft radius.
Experimental API
Parameters
- softRadius[in] tube soft radius - float
Returns
- RLPy.RStatus.Success - Succeed
- RLPy.RStatus.Failure - Fail
1 # No example
Description
This class provides spotlight related operations, i.e. whether or not to cast shadows, light color, light ray direction, light strength, etc.
Constructor & Destructor
__init__ (self, *args, **kwargs)
Initializes a new ri spot light instance.
Parameters
- args
- kwargs
Member Functions
ClearRectTexture (self)
Clears rectangle texture of this light.
GetDarkenShadowStrength (self)
Get the Spotlight's shadow strength at a given point in time (0 to 100). See Also: SetDarkenShadowStrength
GetInverseSquare (self)
Gets if light's intensity follows <a href="https://en.wikipedia.org/wiki/Inverse-square_law">inverse-square law in physics.</a> Its intensity is inversely proportional to the square of the distance from the source.
GetRange (self)
Get the Spotlight's range distance. See Also: SetRange
GetRectWidthHeight (self)
Gets the light's rectangle's width & height.
GetSpotLightBeam (self, fAngle, fFalloff, fAttenuation)
Get the Spotlight's light beam attributes, e.g. beam angle and spill light attenuation (falloff intensity). See Also: SetSpotLightBeam
Parameters
- fAngle
- fFalloff
- fAttenuation
GetTransmission (self)
Returns the transmission.
GetTubeLength (self)
Gets the light's tube length.
GetTubeRadius (self)
Gets the light's tube Radius.
GetTubeSoftRadius (self)
Gets the light's tube SoftRadius.
IsCastShadow (self)
Check whether or not the Spotlight is casting shadows. See Also: SetCastShadow
IsRectangleShape (self)
Gets if light's shape is a rectangle.
IsTubeShape (self)
Gets if light's shape is a tube, sphere is also considered a tube with zero length.
LoadIes (self, strIesFilePath)
Loads an IES file for this light.
Parameters
- strIesFilePath
LoadRectTexture (self, strTexturePath)
Loads a rectangle texture for this light.
Parameters
- strTexturePath
SaveIes (self, strIesFilePath)
Saves the IES file of this light.
Parameters
- strIesFilePath
SaveRectTexture (self, strTexturePath)
Saves the rectangle texture of this light.
Parameters
- strTexturePath
SetCastShadow (self, bEnable)
Turn on / off the Spotlight's cast shadows. See Also: IsCastShadow
Parameters
- bEnable
SetDarkenShadowStrength (self, kTime, fStrength)
Set the Spotlight's shadow strength at a given point in time (0 to 100). See Also: GetDarkenShadowStrength
Parameters
- kTime
- fStrength
SetInverseSquare (self, b)
Sets light's intensity to follow <a href="https://en.wikipedia.org/wiki/Inverse-square_law">inverse-square law in physics.</a>.
Parameters
- b
SetRange (self, kTime, fRange)
Set the Spotlight's range value at a given point in time. See Also: GetRange
Parameters
- kTime
- fRange
SetRectWidthHeight (self, vWidthHeight)
Sets the light's rectangle's width & height.
Parameters
- vWidthHeight
SetRectangleShape (self, bRectangle)
Sets the light's shape to rectangle.
Parameters
- bRectangle
SetSpotLightBeam (self, kTime, fAngle, fFalloff, fAttenuation)
Set the Spotlight's light beam attributes at a given point in time. These attributes include the light beam's angle and spill light attenuation (falloff intensity). See Also: GetSpotLightBeam
Parameters
- kTime
- fAngle
- fFalloff
- fAttenuation
SetTransmission (self, b)
Sets the transmission.
Parameters
- b
SetTubeLength (self, fLength)
Sets the light's tube length.
Parameters
- fLength
SetTubeRadius (self, radius)
Sets the light's tube radius.
Parameters
- radius
SetTubeShape (self, bTube)
Sets the light's shape to tube, sphere is also considered a tube with zero length.
Parameters
- bTube
SetTubeSoftRadius (self, softRadius)
Sets the light's tube soft radius.
Parameters
- softRadius
Properties
thisown
Indicates whether this SWIG proxy owns the underlying C++ object.