IC Python API:RLPy RKey

From Reallusion Wiki!
Jump to: navigation, search
Main article: Modules.
Last modified: 04/15/2020

Description

Keyframes are used to record transition points in an animation. Keyframe values are called "keys". These keys mainly record time and transition data and are managed by controls which are responsible for changing and deleting key values.

This box object's PositionX animation is controlled by RFloatControl.  Thus, this object's timeline transitions are recorded in RFloatKey

See also: RFloatControl, RTransformControl.

Inheritance

RKey > RFloatKey | RTransformKey 

Examples

 1 control = box.GetControl("Transform")
 2 key = RLPy.RTransformKey()
 3 key.SetTime(RLPy.RTime(0))
 4 key.SetTran(transform)
 5 key.SetTransitionType(RLPy.ETransitionType_Ease_Out)
 6 key.SetTransitionStrength(90)
 7 control.AddKey(key, RLPy.RGlobal.GetFps())
 8 
 9 # use RKey to set specular color of the material
10 avatar_list = RLPy.RScene.GetAvatars()
11 material_component = avatar_list [0].GetMaterialComponent()
12 mesh_list = avatar_list[0].GetMeshNames()
13 mesh_name = mesh_list[0]
14 material_list = material_component.GetMaterialNames(mesh_name)
15 material_name = material_list[0]
16 
17 result = self.material_component.AddSpecularKey(RLPy.RKey(), mesh_name, material_name, RLPy.RRgb.BLUE)

Related Enumerations

RLPy.ETransitionType

Transition Type Description UI Name
RLPy.ETransitionType_Invalid Invalid
RLPy.ETransitionType__None None
RLPy.ETransitionType_Linear Linear
RLPy.ETransitionType_Step Step
RLPy.ETransitionType_Ease_Out Ease Out (strength can be set) Decelerate
RLPy.ETransitionType_Ease_In Ease In (strength can be set) Accelerate
RLPy.ETransitionType_Ease_Out_In Ease Out_In (strength can be set) Pause and Move
RLPy.ETransitionType_Ease_In_Out Ease In Out (strength can be set) Smooth
RLPy.ETransitionType_Ease_In_Sine Ease In Sine
RLPy.ETransitionType_Ease_Out_Sine Ease Out Sine
RLPy.ETransitionType_Ease_In_Out_Sine Ease In Out Sine
RLPy.ETransitionType_Ease_In_Quad Ease In Quadratic
RLPy.ETransitionType_Ease_Out_Quad Ease Out Quadratic
RLPy.ETransitionType_Ease_In_Out_Quad Ease In Out Quadratic
RLPy.ETransitionType_Ease_In_Cubic Ease In Cubic
RLPy.ETransitionType_Ease_Out_Cubic Ease Out Cubic
RLPy.ETransitionType_Ease_In_Out_Cubic Ease In Out Cubic
RLPy.ETransitionType_Ease_In_Quart Ease In Quartic
RLPy.ETransitionType_Ease_Out_Quart Ease Out Quartic
RLPy.ETransitionType_Ease_In_Out_Quart Ease In Out Quartic
RLPy.ETransitionType_Ease_In_Quint Ease In Quintic
RLPy.ETransitionType_Ease_Out_Quint Ease Out Quintic
RLPy.ETransitionType_Ease_In_Out_Quint Ease In Out Quintic
RLPy.ETransitionType_Ease_In_Expo Ease In Exponential
RLPy.ETransitionType_Ease_Out_Expo Ease Out Exponential
RLPy.ETransitionType_Ease_In_Out_Expo Ease In Out Exponential
RLPy.ETransitionType_Ease_In_Circ Ease In Circular
RLPy.ETransitionType_Ease_Out_Circ Ease Out Circular
RLPy.ETransitionType_Ease_In_Out_Circ Ease In Out Circular
RLPy.ETransitionType_Ease_In_Back Ease In Back Gain Momentum before Move
RLPy.ETransitionType_Ease_Out_Back Ease Out Back Damping
RLPy.ETransitionType_Ease_In_Out_Back Ease In Out Back Gain Momentum and Damp
RLPy.ETransitionType_Ease_In_Elastic Ease In Elastic Elastic Start and Sudden End
RLPy.ETransitionType_Ease_Out_Elastic Ease Out Elastic Sudden Start with Elastic End
RLPy.ETransitionType_Ease_In_Out_Elastic Ease In Out Elastic Elastic Start and End
RLPy.ETransitionType_Ease_In_Bounce Ease In Bounce Stutter Start
RLPy.ETransitionType_Ease_Out_Bounce Ease Out Bounce End in a Bounce
RLPy.ETransitionType_Ease_In_Out_Bounce Ease In Out Bounce Stuttering Start and End
RLPy.ETransitionType_Last Last
RLPy.ETransitionType_Count Count

Constructor

__init__ (self, args)

Create a new RKey object using an existing RKey object.

Parameters

kRhs [IN] An existing RKey object - RKey
1 key = RLPy.RTransformKey(key1)

Member Functions

Clone ( self )

Copy this key's data and return a new RKey object.

1 

GetTime ( self )

Get this key's time value.

Returns

The time value of this key - RTime
1 

GetTransitionStrength ( self )

Get this key's transition strength. This value lies between 1 and 100 (default: 50). This function will only take effect when the transition type for this key is ETransitionType_EASE_OUT, ETransitionType_EASE_IN, ETransitionType_EASE_OUT_IN or ETransitionType_EASE_IN_OUT.

See Also: SetTransitionStrength

Returns

Transition strength of this key - float
1 strength = key.GetTransitionStrength()

GetTransitionType ( self )

Get this key's transition type.

See Also: SetTransitionType

Returns

This key's transition type - RLPy.ETransitionType
1 type = key.GetTransitionType()

SetTime ( self, kTime )

Set the time value for this key.

Parameters

kTime [IN] Time value for the Key - RTime
1 key.SetTime(RLPy.RTime(0))

SetTransitionStrength ( self, fTransitionStrength )

Set the key's transition strength from 1 to 100 (default: 50). This function will only take effect when the transition type for this key is ETransitionType_EASE_OUT, ETransitionType_EASE_IN, ETransitionType_EASE_OUT_IN or ETransitionType_EASE_IN_OUT.

See Also: GetTransitionStrength, RLPy.ETransitionType

Parameters

fTransitionStrength [IN] The key's transition strength - float
1 key.SetTransitionStrength(90)

SetTransitionType ( self, eTransitionType )

Set the key's transition type.

Parameters

eTransitionType [IN] Transition type of the key - RLPy.ETransitionType
1 key.SetTransitionType(RLPy.ETransitionType_Ease_In)