Difference between revisions of "IC Python API:RLPy RIPointLight"
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 |
||
(4 intermediate revisions by the same user not shown) | |||
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 specific to Point Lights. Besides the inherited member functions from [[IC_Python_API:RLPy_RILight|RILight]], the point light's range value can also be adjusted. | ||
+ | |||
+ | === 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]] | ||
+ | |||
+ | === Examples === | ||
+ | |||
+ | <syntaxhighlight lang="python" line='line'> | ||
+ | light_object = RLPy.RScene.FindObject(RLPy.EObjectType_Light, "Point light") # use light name to find object | ||
+ | |||
# set Parent | # set Parent | ||
result = light_object.SetParent(prop2) | result = light_object.SetParent(prop2) | ||
result = light_object.SetParent(None) #detach from parent | result = light_object.SetParent(None) #detach from parent | ||
− | + | # link to & unlink | |
− | # link to & unlink | + | |
result = light_object.LinkTo(prop2, RLPy.RTime(0)) | result = light_object.LinkTo(prop2, RLPy.RTime(0)) | ||
result = light_object.UnLink(RLPy.RTime(0)) | result = light_object.UnLink(RLPy.RTime(0)) | ||
− | |||
# set name | # set name | ||
light_object.SetName( "new_name" ) | light_object.SetName( "new_name" ) | ||
− | |||
#get bound | #get bound | ||
ret_max = RLPy.RVector3() | ret_max = RLPy.RVector3() | ||
Line 35: | Line 30: | ||
ret = light_object.GetBounds( ret_max, ret_center, ret_min ) | ret = light_object.GetBounds( ret_max, ret_center, ret_min ) | ||
print(ret) | print(ret) | ||
− | |||
#get pivot | #get pivot | ||
ret_pos = RLPy.RVector3() | ret_pos = RLPy.RVector3() | ||
Line 41: | Line 35: | ||
light_object.GetPivot( ret_pos, ret_rot ) | light_object.GetPivot( ret_pos, ret_rot ) | ||
print(ret) | print(ret) | ||
− | |||
#clone object | #clone object | ||
clone_light_object = light_object.Clone() | clone_light_object = light_object.Clone() | ||
print( clone_light_object ) | print( clone_light_object ) | ||
− | |||
#is selected | #is selected | ||
RLPy.RScene.SelectObject(light_object) | RLPy.RScene.SelectObject(light_object) | ||
print(light_object.IsSelected()) #True | print(light_object.IsSelected()) #True | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | == | + | |
− | + | == Member Functions == | |
− | + | ||
− | + | === GetRange ( self ) === | |
− | + | ||
− | + | Get the point light range. | |
− | + | ||
− | + | See Also: [[#SetRange ( self, kTime, fRange )|SetRange]] | |
− | + | ||
− | + | ==== Returns ==== | |
− | + | :The value of the "range" attribute of the light node - float | |
− | + | ||
− | + | <syntaxhighlight lang="python" line='line'> | |
− | + | light_object = RLPy.RScene.FindObject(RLPy.EObjectType_Light, "Point light") # use light name to find object | |
− | | | + | |
− | == | + | #get light range |
− | = | + | print(light_object.GetRange()) |
− | <syntaxhighlight lang=" | + | |
− | RLPy. | + | |
</syntaxhighlight> | </syntaxhighlight> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | === SetRange ( self, kTime, fRange ) === | |
− | + | Set the point light range. | |
− | + | ||
− | + | ||
− | + | ||
− | + | See Also: [[#GetRange ( self )|GetRange]] | |
− | '''RLPy.RStatus.Failure'' | + | ==== Parameters ==== |
− | </ | + | :'''kTime''' [IN] The time at which to set the beam - [[IC_Python_API:RLPy_RTime|RTime]] |
+ | :'''fRange''' [IN] The Light range value - float | ||
+ | |||
+ | ==== Returns ==== | ||
+ | :Success - RLPy.RStatus.Success | ||
+ | :Failure - RLPy.RStatus.Failure | ||
+ | |||
+ | <syntaxhighlight lang="python" line='line'> | ||
+ | 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()) | ||
+ | </syntaxhighlight> |
Latest revision as of 23:45, 14 April 2020
- Main article: Modules.
- Last modified: 04/14/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
1 light_object = RLPy.RScene.FindObject(RLPy.EObjectType_Light, "Point light") # use light name to find object
2
3 # set Parent
4 result = light_object.SetParent(prop2)
5 result = light_object.SetParent(None) #detach from parent
6 # link to & unlink
7 result = light_object.LinkTo(prop2, RLPy.RTime(0))
8 result = light_object.UnLink(RLPy.RTime(0))
9 # set name
10 light_object.SetName( "new_name" )
11 #get bound
12 ret_max = RLPy.RVector3()
13 ret_center = RLPy.RVector3()
14 ret_min = RLPy.RVector3()
15 ret = light_object.GetBounds( ret_max, ret_center, ret_min )
16 print(ret)
17 #get pivot
18 ret_pos = RLPy.RVector3()
19 ret_rot = RLPy.RVector3()
20 light_object.GetPivot( ret_pos, ret_rot )
21 print(ret)
22 #clone object
23 clone_light_object = light_object.Clone()
24 print( clone_light_object )
25 #is selected
26 RLPy.RScene.SelectObject(light_object)
27 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
1 light_object = RLPy.RScene.FindObject(RLPy.EObjectType_Light, "Point light") # use light name to find object
2
3 #get light range
4 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
1 light_object = RLPy.RScene.FindObject(RLPy.EObjectType_Light, "Point light") # use light name to find object
2
3 #set light range
4 light_object.SetRange(RLPy.RTime(0), 1000.0)
5 print(light_object.GetRange())