Difference between revisions of "IC Python API:RLPy RIPointLight"

From Reallusion Wiki!
Jump to: navigation, search
(Created page with "{{TOC}} {{Parent|IC_Python_API:RL_Python_Modules|Modules}} ==Inheritance== This class inherits public member functions from: *RLPy.RILight *IC...")
 
m
Line 1: Line 1:
 
{{TOC}}
 
{{TOC}}
 
{{Parent|IC_Python_API:RL_Python_Modules|Modules}}
 
{{Parent|IC_Python_API:RL_Python_Modules|Modules}}
==Inheritance==
+
{{last_modified}}
This class inherits public member functions from:
+
*[[IC_Python_API:RLPy_RILight|RLPy.RILight]]
+
*[[IC_Python_API:RLPy_RIObject|RLPy.RIObject]]
+
*[[IC_Python_API:RLPy_RIBase|RLPy.RIBase]]
+
==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. <span style="background:#ffcccc">( Experimental Class )</span> <syntaxhighlight lang="Python">
+
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")
+
== Description ==
 +
 
 +
This class provides operations specific to Point Lights.  Besides the inherited member functions from [[IC_Python_API:RLPy_RILight|RILight]], one can also adjust the point light's light range values.
 +
 
 +
=== Inheritance ===
 +
 
 +
*[[IC_Python_API:RLPy_RIBase|RIBase]] > [[IC_Python_API:RLPy_RIObject|RIObject]] > [[IC_Python_API:RLPy_RILight|RILight]] > '''RIPointLight'''.
 +
 
 +
<syntaxhighlight lang="Python">
 +
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 28:
 
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 33:
 
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>
==Operators==
+
 
This class supports the following operators:
+
== Member Functions ==
{| class="wikitable"
+
 
!Member
+
=== GetRange ( self ) ===
!Operation
+
 
!Syntax
+
Get the point light range.
!Description
+
 
!Example
+
See Also: [[#SetRange ( self, kTime, fRange )|SetRange]]
|-
+
 
! scope="row"|__eq__
+
==== Returns ====
|Equality
+
:The value of the "range" attribute of the light node - float
|a == b
+
 
|If the values of two operands are equal, then the condition becomes true.
+
|(a == b) is not true.
+
|}
+
==Member Functions==
+
===GetRange===
+
 
<syntaxhighlight lang="Python">
 
<syntaxhighlight lang="Python">
RLPy.RIPointLight.GetRange ( self )
+
light_object = RLPy.RScene.FindObject(RLPy.EObjectType_Light, "Point light") # use light name to find object
 +
 +
#get light range
 +
print(light_object.GetRange())
 
</syntaxhighlight>
 
</syntaxhighlight>
Get the light range.
 
<span style="background:#ffcccc">( Experimental API )</span>
 
====Returns====
 
<div style="margin-left: 2em;">The value of the "range" attribute of the light node - float
 
</div>
 
-----
 
===SetRange===
 
<syntaxhighlight lang="Python">
 
RLPy.RIPointLight.SetRange ( self, kTime, fRange )
 
</syntaxhighlight>
 
Set the light range.
 
<span style="background:#ffcccc">( Experimental API )</span>
 
====Parameters====
 
<div style="margin-left: 2em;">
 
  
'''kTime''' [in] The time at which to set the beam - RLPy.RTime
+
=== SetRange ( self, kTime, fRange ) ===
  
'''fRange''' [in] The Light range value - float
+
Set the point light range.
</div>
+
====Return Values====
+
<div style="margin-left: 2em;">
+
  
'''RLPy.RStatus.Success''' Success
+
See Also: [[#GetRange ( self )|GetRange]]
  
'''RLPy.RStatus.Failure''' Fail
+
==== Parameters ====
</div>
+
: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">
 +
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>

Revision as of 01:16, 6 April 2020

Main article: Modules.
Last modified: 04/6/2020

Description

This class provides operations specific to Point Lights. Besides the inherited member functions from RILight, one can also adjust the point light's light range values.

Inheritance

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())