Difference between revisions of "IC Python API:RLPy RILight"

From Reallusion Wiki!
Jump to: navigation, search
m
m
 
(3 intermediate revisions by the same user not shown)
Line 5: Line 5:
 
== Description ==
 
== 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.
+
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.
  
:Inheritance: [[IC_Python_API:RLPy_RIBase|RIBase]] > [[IC_Python_API:RLPy_RIObject|RIObject]] > '''RILight'''.
+
=== Inheritance ===
 +
 
 +
[[IC_Python_API:RLPy_RIBase|RIBase]] > [[IC_Python_API:RLPy_RIObject|RIObject]] > [[IC_Python_API:RLPy_RILight|RILight]]
 +
[[IC_Python_API:RLPy_RILight|RILight]] > [[#IC_Python_API:RLPy_RISpotLight|SpotLight]] | [[#IC_Python_API:RLPy_RIPointLight|PointLight]] | [[#IC_Python_API:RLPy_RIDirectionalLight|DirectionalLight]]
  
 
== Member Functions ==
 
== Member Functions ==
Line 15: Line 18:
 
Set the active state for the light.
 
Set the active state for the light.
  
See Also: [[#RLPy.RILight.GetActive( self )|GetActive]]
+
See Also: [[#GetActive( self )|GetActive]]
  
 
==== Parameters ====
 
==== Parameters ====
 
:'''bActive''' [IN] The active state - bool
 
:'''bActive''' [IN] The active state - bool
  
<syntaxhighlight lang="Python">
+
<syntaxhighlight lang="python" line='line'>
 
# Get light object
 
# Get light object
 
light_object = RLPy.RScene.FindObject(RLPy.EObjectType_Light, "Spotlight")
 
light_object = RLPy.RScene.FindObject(RLPy.EObjectType_Light, "Spotlight")
Line 32: Line 35:
 
Get the active state of the light.
 
Get the active state of the light.
  
See Also: [[#RLPy.RILight.SetActive( self, bActive )|SetActive]]
+
See Also: [[#SetActive( self, bActive )|SetActive]]
  
 
==== Returns ====
 
==== Returns ====
 
:Whether or not the light is active - bool
 
:Whether or not the light is active - bool
  
<syntaxhighlight lang="Python">
+
<syntaxhighlight lang="python" line='line'>
 
# Get light object
 
# Get light object
 
light_object = RLPy.RScene.FindObject(RLPy.EObjectType_Light, "Spotlight")
 
light_object = RLPy.RScene.FindObject(RLPy.EObjectType_Light, "Spotlight")
Line 50: Line 53:
 
Set the light's strength value at a given time.
 
Set the light's strength value at a given time.
  
See Also: [[RLPy.RILight.GetMultiplier( self )|GetMultiplier]]
+
See Also: [[#GetMultiplier( self )|GetMultiplier]]
  
 
==== Parameters ====
 
==== Parameters ====
Line 60: Line 63:
 
:Failure - RLPy.RStatus.Failure
 
:Failure - RLPy.RStatus.Failure
  
<syntaxhighlight lang="Python">
+
<syntaxhighlight lang="python" line='line'>
 
# Get light object
 
# Get light object
 
light_object = RLPy.RScene.FindObject(RLPy.EObjectType_Light, "Spotlight")
 
light_object = RLPy.RScene.FindObject(RLPy.EObjectType_Light, "Spotlight")
Line 72: Line 75:
 
Get the light's current strength.
 
Get the light's current strength.
  
See Also: [[#RLPy.RILight.SetMultiplier( self, kTime, fMultiplier )|SetMultiplier]]
+
See Also: [[#SetMultiplier( self, kTime, fMultiplier )|SetMultiplier]]
  
 
==== Returns ====
 
==== Returns ====
 
:The strength of the light - float
 
:The strength of the light - float
  
<syntaxhighlight lang="Python">
+
<syntaxhighlight lang="python" line='line'>
 
# Get light object
 
# Get light object
 
light_object = RLPy.RScene.FindObject(RLPy.EObjectType_Light, "Spotlight")
 
light_object = RLPy.RScene.FindObject(RLPy.EObjectType_Light, "Spotlight")
Line 90: Line 93:
 
Set the light's color at a given time.
 
Set the light's color at a given time.
  
See Also: [[#RLPy.RILight.GetColor( self )|GetColor]]
+
See Also: [[#GetColor( self )|GetColor]]
  
 
==== Parameters ====
 
==== Parameters ====
Line 100: Line 103:
 
:Failure - RLPy.RStatus.Failure
 
:Failure - RLPy.RStatus.Failure
  
<syntaxhighlight lang="Python">
+
<syntaxhighlight lang="python" line='line'>
 
# Get light object
 
# Get light object
 
light_object = RLPy.RScene.FindObject(RLPy.EObjectType_Light, "Spotlight")
 
light_object = RLPy.RScene.FindObject(RLPy.EObjectType_Light, "Spotlight")
Line 112: Line 115:
 
Get the light's color at a given time.
 
Get the light's color at a given time.
  
See Also: [[#RLPy.RILight.SetColor( self, kTime, kColor )|SetColor]]
+
See Also: [[#SetColor( self, kTime, kColor )|SetColor]]
  
 
==== Returns ====
 
==== Returns ====
 
:The light's color in '''RRgb''' - [[IC_Python_API:RLPy_RRgb|RRgb]]
 
:The light's color in '''RRgb''' - [[IC_Python_API:RLPy_RRgb|RRgb]]
  
<syntaxhighlight lang="Python">
+
<syntaxhighlight lang="python" line='line'>
 
# Get light object
 
# Get light object
 
light_object = RLPy.RScene.FindObject(RLPy.EObjectType_Light, "Spotlight")
 
light_object = RLPy.RScene.FindObject(RLPy.EObjectType_Light, "Spotlight")

Latest revision as of 01:00, 15 April 2020

Main article: Modules.
Last modified: 04/15/2020

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.

Inheritance

RIBase > RIObject > RILight 
RILight > SpotLight | PointLight | DirectionalLight

Member Functions

SetActive ( self, bActive )

Set the active state for the light.

See Also: GetActive

Parameters

bActive [IN] The active state - bool
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)

GetActive ( self )

Get the active state of the light.

See Also: SetActive

Returns

Whether or not the light is 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 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
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)

GetMultiplier ( self )

Get the light's current strength.

See Also: SetMultiplier

Returns

The strength of the light - 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 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
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)

GetColor ( self )

Get the light's color at a given time.

See Also: SetColor

Returns

The light's color in RRgb - 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 print(light_color)