Difference between revisions of "IC Python API:RLPy RIDirectionalLight"
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.RILight *IC...") |
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 == | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | 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. | |
− | + | ||
− | + | ||
− | + | ||
− | + | === Inheritance === | |
− | + | ||
− | + | *[[IC_Python_API:RLPy_RIBase|RIBase]] > [[IC_Python_API:RLPy_RIObject|RIObject]] > [[IC_Python_API:RLPy_RILight|RILight]] > '''RIDirectionalLight'''. | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | == Member Functions == | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | === SetCastShadow ( self, bEnable ) === | |
− | + | ||
− | + | Turn on or off the directional light's cast shadow. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
<syntaxhighlight lang="Python"> | <syntaxhighlight lang="Python"> | ||
− | RLPy. | + | light_object = RLPy.RScene.FindObject(RLPy.EObjectType_Light, "Dir. Light") |
+ | |||
+ | if light_object: | ||
+ | light_object.SetCastShadow(True) | ||
+ | light_object.SetCastShadow(False) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | + | ||
− | + | ==== Parameters ==== | |
− | ====Returns==== | + | :bEnable [in] Enable or disable cast shadows for the light - bool |
− | + | ||
− | + | ==== Returns ==== | |
− | + | :Success - RLPy.RStatus.Success | |
− | ===IsCastShadow=== | + | :Failure - RLPy.RStatus.Failure |
+ | |||
+ | === IsCastShadow ( self ) === | ||
+ | |||
+ | Check whether or not the light is casting shadows. | ||
+ | |||
<syntaxhighlight lang="Python"> | <syntaxhighlight lang="Python"> | ||
− | RLPy. | + | light_object = RLPy.RScene.FindObject(RLPy.EObjectType_Light, "Dir. Light") |
+ | |||
+ | if light_object: | ||
+ | light_object.SetCastShadow(True) | ||
+ | print(light_object.IsCastShadow()) | ||
+ | |||
+ | light_object.SetCastShadow(False) | ||
+ | print(light_object.IsCastShadow()) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | ==== Returns ==== | |
− | + | :'''True''' if the light is casting shadows, else '''False''' - bool | |
− | ==== | + | |
− | + | ||
− | ' | + | === SetDarkenShadowStrength ( self, kTime, fStrength ) === |
+ | |||
+ | Set the directional light's shadow strength at a given point in time (0 to 100). | ||
− | |||
− | |||
− | |||
− | |||
<syntaxhighlight lang="Python"> | <syntaxhighlight lang="Python"> | ||
− | RLPy. | + | light_object = RLPy.RScene.FindObject(RLPy.EObjectType_Light, "Dir. Light") |
+ | |||
+ | if light_object: | ||
+ | result = light_object.SetDarkenShadowStrength(RLPy.RGlobal.GetTime(), 50) | ||
+ | print(result) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | |||
− | |||
− | |||
− | |||
− | + | ==== Parameters ==== | |
− | + | :fStrength [in] The Light shadow strength value - float | |
− | + | ||
− | + | ||
− | + | ==== Returns ==== | |
+ | :RLPy.RStatus.Success Success | ||
+ | :RLPy.RStatus.Failure Fail | ||
− | '' | + | === GetDarkenShadowStrength ( self ) === |
− | </ | + | |
+ | Get the directional light's shadow strength at a given point in time (0 to 100). | ||
+ | |||
+ | ==== Returns ==== | ||
+ | :The light's shadow strength value - float | ||
+ | |||
+ | <syntaxhighlight lang="Python"> | ||
+ | light_object = RLPy.RScene.FindObject(RLPy.EObjectType_Light, "Dir. Light") | ||
+ | |||
+ | if light_object: | ||
+ | result = light_object.SetDarkenShadowStrength(RLPy.RGlobal.GetTime(), 50) | ||
+ | print(light_object.GetDarkenShadowStrength()) | ||
+ | </syntaxhighlight> |
Revision as of 01:09, 6 April 2020
Contents
- Main article: Modules.
- Last modified: 04/6/2020
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.
Inheritance
Member Functions
SetCastShadow ( self, bEnable )
Turn on or off the directional light's cast shadow.
light_object = RLPy.RScene.FindObject(RLPy.EObjectType_Light, "Dir. Light")
if light_object:
light_object.SetCastShadow(True)
light_object.SetCastShadow(False)
Parameters
- bEnable [in] Enable or disable cast shadows for the light - bool
Returns
- Success - RLPy.RStatus.Success
- Failure - RLPy.RStatus.Failure
IsCastShadow ( self )
Check whether or not the light is casting shadows.
light_object = RLPy.RScene.FindObject(RLPy.EObjectType_Light, "Dir. Light")
if light_object:
light_object.SetCastShadow(True)
print(light_object.IsCastShadow())
light_object.SetCastShadow(False)
print(light_object.IsCastShadow())
Returns
- True if the light is casting shadows, else False - bool
SetDarkenShadowStrength ( self, kTime, fStrength )
Set the directional light's shadow strength at a given point in time (0 to 100).
light_object = RLPy.RScene.FindObject(RLPy.EObjectType_Light, "Dir. Light")
if light_object:
result = light_object.SetDarkenShadowStrength(RLPy.RGlobal.GetTime(), 50)
print(result)
Parameters
- fStrength [in] The Light shadow strength value - float
Returns
- RLPy.RStatus.Success Success
- RLPy.RStatus.Failure Fail
GetDarkenShadowStrength ( self )
Get the directional light's shadow strength at a given point in time (0 to 100).
Returns
- The light's shadow strength value - float
light_object = RLPy.RScene.FindObject(RLPy.EObjectType_Light, "Dir. Light")
if light_object:
result = light_object.SetDarkenShadowStrength(RLPy.RGlobal.GetTime(), 50)
print(light_object.GetDarkenShadowStrength())