IC Python API:RLPy RIPointLight

From Reallusion Wiki!
Revision as of 01:36, 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 point 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, "Point light") # use light name to find object

#set light range
light_object.SetRange(RLPy.RTime(0), 1000.0)
print(light_object.GetRange())

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

# link to & unlink
result = light_object.LinkTo(prop2, RLPy.RTime(0))
result = light_object.UnLink(RLPy.RTime(0))

# 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

GetRange

RLPy.RIPointLight.GetRange ( self )

Get the light range. ( Experimental API )

Returns

The value of the "range" attribute of the light node - float

SetRange

RLPy.RIPointLight.SetRange ( self, kTime, fRange )

Set the light range. ( Experimental API )

Parameters

kTime [in] The time at which to set the beam - RLPy.RTime

fRange [in] The Light range value - float

Return Values

RLPy.RStatus.Success Success

RLPy.RStatus.Failure Fail