IC Python API:RLPy RILight

From Reallusion Wiki!
Revision as of 01:37, 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.RIObject *...")

(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 lights 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, "Spotlight") # use light name to find object
light_object.SetActive(True)
print(light_object.GetActive())

# set light multiplier
light_object.SetMultiplier(RLPy.RTime(0), 8.0)
print(light_object.GetMultiplier())

# set light color
color = RLPy.RRgb.RED
light_object.SetColor(RLPy.RTime(0), color)
light_object.GetColor().R() # is 1.0
light_object.GetColor().G() # is 0.0
light_object.GetColor().B() # is 0.0

# change light transform
control = light_object.GetControl("Transform")
transform = RLPy.RTransform.IDENTITY
transform.T().x = -75.0
transform.T().y = -150.0
transform.T().z = 250.0
time = RLPy.RTime(0)
control.SetValue(time, transform)

#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

GetActive

RLPy.RILight.GetActive ( self )

Get if light is active. ( Experimental API )

Returns

True if light is active, False if light is not active - bool

GetColor

RLPy.RILight.GetColor ( self )

Get the light's color. ( Experimental API )

Returns

The value of the "color" attribute of the light node - RLPy.RRgb

GetMultiplier

RLPy.RILight.GetMultiplier ( self )

Get the light's multiplier. ( Experimental API )

Returns

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

SetActive

RLPy.RILight.SetActive ( self, bActive )

Set if light is active. ( Experimental API )

Parameters

bActive [in] If light is active - bool

Return Values

RLPy.RStatus.Success Success

RLPy.RStatus.Failure Fail


SetColor

RLPy.RILight.SetColor ( self, kTime, kColor )

Set the light's color. ( Experimental API )

Parameters

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

kColor [in] The Light RGB value - RLPy.RRgb

Return Values

RLPy.RStatus.Success Success

RLPy.RStatus.Failure Fail


SetMultiplier

RLPy.RILight.SetMultiplier ( self, kTime, fMultiplier )

Set the light's multiplier. ( Experimental API )

Parameters

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

fMultiplier [in] The Light multiplier value - float

Return Values

RLPy.RStatus.Success Success

RLPy.RStatus.Failure Fail

Inherited By

This class is inherited by the following classes:

Class Description
DirectionalLight The interface to directional light in the scene.
PointLight The interface to point light in the scene.
SpotLight The interface to spot light in the scene.