IC8 Python API:RLPy RILight
From Reallusion Wiki!
- Main article: iC8 Modules.
- Last modified: 01/3/2023
Description
This is the base class for all light sources and provides settings for some basic properties, e.g. active states, strength, color values, etc. It also provides a Transform Control with the ability to set translation, rotation, and scale keys.
Class Methods
RLPy.RILight.GetActive(self)
Check if the light is active.
Experimental API
Returns
True if light is active, False if light is not active - bool
1 # Get light object
2 light_object = RLPy.RScene.FindObject(RLPy.EObjectType_Light, "Spotlight")
3
4 # Get light object active status
5 active_status = light_object.GetActive()
6
7 print(active_status)
RLPy.RILight.GetColor(self)
Get the light's color.
Experimental API
Returns
The value of the "color" attribute of the light node - RLPy.RRgb
1 # Get light object
2 light_object = RLPy.RScene.FindObject(RLPy.EObjectType_Light, "Spotlight")
3
4 # Set light object color value
5 light_color = light_object.GetColor()
6
7 print(light_color)
RLPy.RILight.GetMultiplier(self)
Get the light's multiplier.
Experimental API
Returns
The value of the "multiplier" attribute of the light node - float
1 # Get light object
2 light_object = RLPy.RScene.FindObject(RLPy.EObjectType_Light, "Spotlight")
3
4 # Get light object multiplier value
5 multiplier_value = light_object.GetMultiplier()
6
7 print(multiplier_value)
RLPy.RILight.SetActive(self, kTime, bActive)
Activate or deactivate the light.
Experimental API
Parameters
- bActive[in] If light is active - bool
Returns
- RLPy.RStatus.Success - Succeed
- RLPy.RStatus.Failure - Fail
1 # Get light object
2 light_object = RLPy.RScene.FindObject(RLPy.EObjectType_Light, "Spotlight")
3
4 # Set light object active status
5 light_object.SetActive(True)
RLPy.RILight.SetColor(self, kTime, kColor)
Set the light's color.
Experimental API
Parameters
- kTime[in] The time at which to set the color - RLPy.RLTime
- kColor[in] The Light RGB value - RLPy.RRgb
Returns
- RLPy.RStatus.Success - Succeed
- RLPy.RStatus.Failure - Fail
1 # Get light object
2 light_object = RLPy.RScene.FindObject(RLPy.EObjectType_Light, "Spotlight")
3
4 # Set light object color value
5 result = light_object.SetColor(RLPy.RTime(0), RLPy.RRgb.RED)
RLPy.RILight.SetMultiplier(self, kTime, fMultiplier)
Set the light's multiplier.
Experimental API
Parameters
- kTime[in] The time at which to set the multiplier - RLPy.RLTime
- fMultiplier[in] The Light multiplier value - float
Returns
- RLPy.RStatus.Success - Succeed
- RLPy.RStatus.Failure - Fail
1 # Get light object
2 light_object = RLPy.RScene.FindObject(RLPy.EObjectType_Light, "Spotlight")
3
4 # Set light object multiplier value
5 result = light_object.SetMultiplier(RLPy.RTime(0), 8.0)