IC Python API:RLPy RIDirectionalLight

From Reallusion Wiki!
Revision as of 01:38, 28 March 2019 by 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...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Main article: Modules.

Inheritance

This class inherits public member functions from:

Detailed Description

This class is the interface to directional light in the scene. It provides methods to access various parts of a light such as transformation, color, range etc. All methods of this class are

implemented by the system. ( Experimental Class )
light_object = RLPy.RScene.FindObject(RLPy.EObjectType_Light, "Dir. Light") # use light name to find object

light_object.SetCastShadow(True)
print(light_object.IsCastShadow())

#set light shadow strength
light_object.SetDarkenShadowStrength(RLPy.RTime(0), 50.0)
print(light_object.GetDarkenShadowStrength())

prop2 = RLPy.RScene.FindObject(RLPy.EObjectType_Prop, "Box2")
# set Parent
result = light_object.SetParent(prop2)
result = light_object.SetParent(None) #detach from parent

# set name
light_object.SetName( "new_name" )

#get bound
ret_max = RLPy.RVector3()
ret_center = RLPy.RVector3()
ret_min = RLPy.RVector3()
ret = light_object.GetBounds( ret_max, ret_center, ret_min )
print(ret)

#get pivot
ret_pos = RLPy.RVector3()
ret_rot = RLPy.RVector3()
light_object.GetPivot( ret_pos, ret_rot )
print(ret)

#clone object
clone_light_object = light_object.Clone()
print( clone_light_object )

#is selected
RLPy.RScene.SelectObject(light_object)
print(light_object.IsSelected()) #True

Operators

This class supports the following operators:

Member Operation Syntax Description Example
__eq__ Equality a == b If the values of two operands are equal, then the condition becomes true. (a == b) is not true.

Member Functions

GetDarkenShadowStrength

RLPy.RIDirectionalLight.GetDarkenShadowStrength ( self )

Get the light darken shadow strength. ( Experimental API )

Returns

The value of the "shadow strength" attribute of the light node - float

IsCastShadow

RLPy.RIDirectionalLight.IsCastShadow ( self )

Get the light if cast shadow enable. ( Experimental API )

Returns

True if light is cast shadow enable, False if not - bool

SetCastShadow

RLPy.RIDirectionalLight.SetCastShadow ( self, bEnable )

Set the light's cast shadow is enable. ( Experimental API )

Parameters

bEnable [in] If light's cast shadow is enable - bool

Return Values

RLPy.RStatus.Success Success

RLPy.RStatus.Failure Fail


SetDarkenShadowStrength

RLPy.RIDirectionalLight.SetDarkenShadowStrength ( self, kTime, fStrength )

Set the light's shadow strength. ( Experimental API )

Parameters

fStrength [in] The Light shadow strength value - float

Return Values

RLPy.RStatus.Success Success

RLPy.RStatus.Failure Fail