Difference between revisions of "IC Python API:RLPy RIPointLight"
From Reallusion Wiki!
Chuck (RL) (Talk | contribs) m |
Chuck (RL) (Talk | contribs) m |
||
Line 9: | Line 9: | ||
=== Inheritance === | === Inheritance === | ||
− | [[IC_Python_API:RLPy_RIBase|RIBase]] > [[IC_Python_API:RLPy_RIObject|RIObject]] > [[IC_Python_API:RLPy_RILight|RILight]] > [[IC_Python_API:RLPy_RIPointLight|RIPointLight]] | + | [[IC_Python_API:RLPy_RIBase|RIBase]] > [[IC_Python_API:RLPy_RIObject|RIObject]] > [[IC_Python_API:RLPy_RILight|RILight]] > [[IC_Python_API:RLPy_RIPointLight|RIPointLight]] |
+ | |||
+ | === Examples === | ||
<syntaxhighlight lang="python"> | <syntaxhighlight lang="python"> |
Revision as of 01:43, 9 April 2020
- Main article: Modules.
- Last modified: 04/9/2020
Description
This class provides operations specific to Point Lights. Besides the inherited member functions from RILight, the point light's range value can also be adjusted.
Inheritance
RIBase > RIObject > RILight > RIPointLight
Examples
light_object = RLPy.RScene.FindObject(RLPy.EObjectType_Light, "Point light") # use light name to find object
# 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
Member Functions
GetRange ( self )
Get the point light range.
See Also: SetRange
Returns
- The value of the "range" attribute of the light node - float
light_object = RLPy.RScene.FindObject(RLPy.EObjectType_Light, "Point light") # use light name to find object
#get light range
print(light_object.GetRange())
SetRange ( self, kTime, fRange )
Set the point light range.
See Also: GetRange
Parameters
- kTime [IN] The time at which to set the beam - RTime
- fRange [IN] The Light range value - float
Returns
- Success - RLPy.RStatus.Success
- Failure - RLPy.RStatus.Failure
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())