Difference between revisions of "IC Python API:RLPy RILight"
From Reallusion Wiki!
Chuck (RL) (Talk | contribs) (Created page with "{{TOC}} {{Parent|IC_Python_API:RL_Python_Modules|Modules}} ==Inheritance== This class inherits public member functions from: *RLPy.RIObject *...") |
Chuck (RL) (Talk | contribs) m |
||
Line 1: | Line 1: | ||
{{TOC}} | {{TOC}} | ||
{{Parent|IC_Python_API:RL_Python_Modules|Modules}} | {{Parent|IC_Python_API:RL_Python_Modules|Modules}} | ||
− | + | {{last_modified}} | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | == Description == | |
− | + | ||
− | + | '''RILight''' 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. | |
+ | |||
+ | :Inheritance: [[IC_Python_API:RLPy_RIBase|RIBase]] > [[IC_Python_API:RLPy_RIObject|RIObject]] > '''RILight'''. | ||
+ | |||
+ | == Member Functions == | ||
+ | |||
+ | === SetActive ( self, bActive ) === | ||
+ | |||
+ | Set the active state for the light. | ||
+ | |||
+ | See Also: [[#RLPy.RILight.GetActive( self )|GetActive]] | ||
+ | |||
+ | ==== Parameters ==== | ||
+ | :'''bActive''' [IN] The active state - bool | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
<syntaxhighlight lang="Python"> | <syntaxhighlight lang="Python"> | ||
− | RLPy. | + | # Get light object |
+ | light_object = RLPy.RScene.FindObject(RLPy.EObjectType_Light, "Spotlight") | ||
+ | |||
+ | # Set light object active status | ||
+ | light_object.SetActive(True) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | Get | + | |
− | + | === GetActive ( self ) === | |
− | ====Returns==== | + | |
− | + | Get the active state of the light. | |
− | + | ||
− | + | See Also: [[#RLPy.RILight.SetActive( self, bActive )|SetActive]] | |
− | + | ||
+ | ==== Returns ==== | ||
+ | :Whether or not the light is active - bool | ||
+ | |||
<syntaxhighlight lang="Python"> | <syntaxhighlight lang="Python"> | ||
− | RLPy. | + | # Get light object |
+ | light_object = RLPy.RScene.FindObject(RLPy.EObjectType_Light, "Spotlight") | ||
+ | |||
+ | # Get light object active status | ||
+ | active_status = light_object.GetActive() | ||
+ | print(active_status) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | + | ||
− | + | === SetMultiplier ( self, kTime, fMultiplier ) === | |
− | ==== | + | |
− | + | Set the light's strength value at a given time. | |
− | + | ||
− | + | See Also: [[RLPy.RILight.GetMultiplier( self )|GetMultiplier]] | |
− | === | + | |
+ | ==== Parameters ==== | ||
+ | :'''kTime''' [IN] Time at which to set the light's strength value - [[IC_Python_API:RLPy_RTime|RTime]] | ||
+ | :'''fMultiplier''' [IN] The strength value - float | ||
+ | |||
+ | ==== Returns ==== | ||
+ | :Success - RLPy.RStatus.Success | ||
+ | :Failure - RLPy.RStatus.Failure | ||
+ | |||
<syntaxhighlight lang="Python"> | <syntaxhighlight lang="Python"> | ||
− | RLPy. | + | # Get light object |
+ | light_object = RLPy.RScene.FindObject(RLPy.EObjectType_Light, "Spotlight") | ||
+ | |||
+ | # Set light object multiplier value | ||
+ | result = light_object.SetMultiplier(RLPy.RTime(0), 8.0) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | === GetMultiplier ( self ) === | |
− | + | ||
− | ==== | + | |
− | + | ||
− | ' | + | Get the light's current strength. |
+ | |||
+ | See Also: [[#RLPy.RILight.SetMultiplier( self, kTime, fMultiplier )|SetMultiplier]] | ||
+ | |||
+ | ==== Returns ==== | ||
+ | :The strength of the light - float | ||
− | |||
− | |||
− | |||
− | |||
<syntaxhighlight lang="Python"> | <syntaxhighlight lang="Python"> | ||
− | RLPy. | + | # Get light object |
+ | light_object = RLPy.RScene.FindObject(RLPy.EObjectType_Light, "Spotlight") | ||
+ | |||
+ | # Get light object multiplier value | ||
+ | multiplier_value = light_object.GetMultiplier() | ||
+ | print(multiplier_value) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | |||
− | |||
− | |||
− | |||
− | + | === SetColor ( self, kTime, kColor ) === | |
− | ' | + | Set the light's color at a given time. |
− | + | ||
− | + | ||
− | + | ||
− | '''RLPy.RStatus.Success | + | See Also: [[#RLPy.RILight.GetColor( self )|GetColor]] |
+ | |||
+ | ==== Parameters ==== | ||
+ | :'''kTime''' [IN] Time at which to set the light's color - [[IC_Python_API:RLPy_RTime|RTime]] | ||
+ | :'''kColor''' [IN] The target color for the light - [[IC_Python_API:RLPy_RRgb|RRgb]] | ||
+ | |||
+ | ==== Returns ==== | ||
+ | :Success - RLPy.RStatus.Success | ||
+ | :Failure - RLPy.RStatus.Failure | ||
− | |||
− | |||
− | |||
− | |||
<syntaxhighlight lang="Python"> | <syntaxhighlight lang="Python"> | ||
− | RLPy. | + | # Get light object |
+ | light_object = RLPy.RScene.FindObject(RLPy.EObjectType_Light, "Spotlight") | ||
+ | |||
+ | # Set light object color value | ||
+ | result = light_object.SetColor(RLPy.RTime(0), RLPy.RRgb.RED) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | |||
− | |||
− | |||
− | |||
− | + | === GetColor ( self ) === | |
− | ' | + | Get the light's color at a given time. |
− | + | ||
− | + | ||
− | + | ||
− | + | See Also: [[#RLPy.RILight.SetColor( self, kTime, kColor )|SetColor]] | |
− | + | ==== Returns ==== | |
− | + | :The light's color in '''RRgb''' - [[IC_Python_API:RLPy_RRgb|RRgb]] | |
− | == | + | |
− | + | <syntaxhighlight lang="Python"> | |
− | + | # Get light object | |
− | + | light_object = RLPy.RScene.FindObject(RLPy.EObjectType_Light, "Spotlight") | |
− | + | ||
− | + | # Set light object color value | |
− | + | light_color = light_object.GetColor() | |
− | + | print(light_color) | |
− | + | </syntaxhighlight> | |
− | + | ||
− | + | ||
− | + |
Revision as of 00:24, 6 April 2020
- Main article: Modules.
- Last modified: 04/6/2020
Description
RILight 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.
Member Functions
SetActive ( self, bActive )
Set the active state for the light.
See Also: GetActive
Parameters
- bActive [IN] The active state - bool
# Get light object
light_object = RLPy.RScene.FindObject(RLPy.EObjectType_Light, "Spotlight")
# Set light object active status
light_object.SetActive(True)
GetActive ( self )
Get the active state of the light.
See Also: SetActive
Returns
- Whether or not the light is active - bool
# Get light object
light_object = RLPy.RScene.FindObject(RLPy.EObjectType_Light, "Spotlight")
# Get light object active status
active_status = light_object.GetActive()
print(active_status)
SetMultiplier ( self, kTime, fMultiplier )
Set the light's strength value at a given time.
See Also: GetMultiplier
Parameters
- kTime [IN] Time at which to set the light's strength value - RTime
- fMultiplier [IN] The strength value - float
Returns
- Success - RLPy.RStatus.Success
- Failure - RLPy.RStatus.Failure
# Get light object
light_object = RLPy.RScene.FindObject(RLPy.EObjectType_Light, "Spotlight")
# Set light object multiplier value
result = light_object.SetMultiplier(RLPy.RTime(0), 8.0)
GetMultiplier ( self )
Get the light's current strength.
See Also: SetMultiplier
Returns
- The strength of the light - float
# Get light object
light_object = RLPy.RScene.FindObject(RLPy.EObjectType_Light, "Spotlight")
# Get light object multiplier value
multiplier_value = light_object.GetMultiplier()
print(multiplier_value)
SetColor ( self, kTime, kColor )
Set the light's color at a given time.
See Also: GetColor
Parameters
- kTime [IN] Time at which to set the light's color - RTime
- kColor [IN] The target color for the light - RRgb
Returns
- Success - RLPy.RStatus.Success
- Failure - RLPy.RStatus.Failure
# Get light object
light_object = RLPy.RScene.FindObject(RLPy.EObjectType_Light, "Spotlight")
# Set light object color value
result = light_object.SetColor(RLPy.RTime(0), RLPy.RRgb.RED)
GetColor ( self )
Get the light's color at a given time.
See Also: SetColor
Returns
- The light's color in RRgb - RRgb
# Get light object
light_object = RLPy.RScene.FindObject(RLPy.EObjectType_Light, "Spotlight")
# Set light object color value
light_color = light_object.GetColor()
print(light_color)