IC8 Python API:RLPy RIClip

From Reallusion Wiki!
Jump to: navigation, search
Main article: iC8 Modules.
Last modified: 01/9/2023

Description

An animation clip representes a sequence of connected motions. Different types of animations can be derived from composing clips and applying various clip operations. Animation clips are recorded for each character bone node or a scene object itself. One can access an animation clip's transform control via RIClip, to facilitate subsequent key operations.

Animation keys reside in clips:

Rlpy riclip img 01.png

Class Methods

RLPy.RIClip.ClipTimeToSceneTime(self, kClipTick)

Convert clip time to Scene time.

Parameters

kClipTime[IN] clip time.

Returns

Scene time - RLPy.RLTime

 1 # Get skeleton component
 2 avatar_list = RLPy.RScene.GetAvatars()
 3 avatar = avatar_list[0]
 4 bone = avatar.GetSkeletonComponent()
 5 
 6 # Clip time to scene time
 7 clip_index = 1
 8 clip = bone.GetClip(clip_index)
 9 clip_time = RLPy.RTime(2000)
10 scene_time = clip.ClipTimeToSceneTime(clip_time)

RLPy.RIClip.GetClipLength(self)

Get length of the clip.

Affected by whether there is loop and adjusting speed.)

Returns

clip length - RLPy.RLTime

1 # No example

RLPy.RIClip.GetControl(self, strKey, spNode)

Get transform control of the bone node.

Parameters

strKey[IN] Key of the controller, allowing use "Layer" as the key to retrieve the control of the Motion Layer in the clip - string
spNode[IN] Specifies the corresponding node to get the control - RLPy.RIBase

Returns

Return the controller of the specified key. It will return null while not found or the key is invalid - RLPy.RControl

1 # Get skeleton component
2 avatar_list = RLPy.RScene.GetAvatars()
3 avatar = avatar_list[0]
4 bone = avatar.GetSkeletonComponent()
5 
6 # Get transform control from bone root
7 clip_index = 1
8 clip = bone.GetClip(clip_index)
9 transform_control = clip.GetControl("Layer", bone.GetRootBone())

RLPy.RIClip.GetDataBlock(self, strKey, spBase)

Get DataBlock of specify data.

Parameters

strKey[IN] Key of the controller, allowing use "Layer" as the key to retrieve the data block of the layer keys in the clip - string
spBase[IN] Specifies the corresponding object to get the data block - RLPy.RIBase

Returns

Return the data block of the specified key. It will return null while not found or the key is invalid - RLPy.RDataBlock

1 # No example

RLPy.RIClip.GetEffectorDataBlock(self, strKey, spBase, spDataBlock, spActiveDataBlock)

Get DataBlock of effector.

Parameters

strKey[IN] Key of the controller, allowing use "Layer" as the key to retrieve the data block of the layer keys in the clip - string
spBase[IN] Specifies the corresponding object to get the effector data block - RLPy.RIBase

spDataBlock[OUT] the translattion/rotation data block of effector - RLPy.RDataBlock spActiveDataBlock[OUT] the active data block of effector - RLPy.RDataBlock

Returns

RLPy.RStatus.Success - Succeed
RLPy.RStatus.Failure - Fail
1 # No example

RLPy.RIClip.GetLastKeyTime(self)

Get time of the last key in the clip.

Returns

time of the last key in the clip - RLPy.RLTime

1 # Get skeleton component
2 avatar_list = RLPy.RScene.GetAvatars()
3 avatar = avatar_list[0]
4 bone = avatar.GetSkeletonComponent()
5 
6 # Get last key time
7 clip_index = 1
8 clip = bone.GetClip(clip_index)
9 last_key_time = clip.GetLastKeyTime()

RLPy.RIClip.GetLength(self)

Get length of the clip.

Returns

clip length - RLPy.RLTime

1 # Get skeleton component
2 avatar_list = RLPy.RScene.GetAvatars()
3 avatar = avatar_list[0]
4 bone = avatar.GetSkeletonComponent()
5 
6 # Get clip length
7 clip_index = 1
8 clip = bone.GetClip(clip_index)
9 clip_len = clip.GetLength()

RLPy.RIClip.GetLoopCount(self)

get the loop count of the clip

Returns

loop count - float

1 # No example

RLPy.RIClip.GetSpeed(self)

get the speed of the clip

Returns

clip speed - float

1 # No example

RLPy.RIClip.GetTransitionData(self)

Get transition data of the clip.

Returns

list of the transition time [fade-in start, fade-in end, fade-out start, fade- out end] - list

1 # No example

RLPy.RIClip.GetTransitionRange(self)

Get fade-in transition time.

Returns

transition time - RLPy.RLTime

1 # No example

RLPy.RIClip.GetTransitionStrength(self, bFadeIn)

Get transition strength of the clip.

Parameters

bFadeIn[IN] true: fade-in, false: fade-out - bool

Returns

Transition strength of the clip (0~100) - float

1 # No example

RLPy.RIClip.GetTransitionType(self, bFadeIn)

Get transition type of the clip.

Parameters

bFadeIn[IN] true: fade-in, false: fade-out - bool

Returns

Transition type of the clip - RLPy.ETransitionType

  • RLPy.ETransitionType_Invalid Invalid value.
  • RLPy.ETransitionType_None None.
  • RLPy.ETransitionType_Linear Linear.
  • RLPy.ETransitionType_Step Step.
  • RLPy.ETransitionType_Ease_Out Ease out.
  • RLPy.ETransitionType_Ease_In Ease in.
  • RLPy.ETransitionType_Ease_Out_In Ease out in.
  • RLPy.ETransitionType_Ease_In_Out Ease in out.
  • 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 quad.
  • RLPy.ETransitionType_Ease_Out_Quad Ease out quad.
  • RLPy.ETransitionType_Ease_In_Out_Quad Ease in out quad.
  • RLPy.ETransitionType_Ease_In_Cubic Ease in cubic.
  • RLPy.ETransitionType_Ease_Out_Cubic Ease in out cubic.
  • RLPy.ETransitionType_Ease_In_Out_Cubic Ease in out cubic.
  • RLPy.ETransitionType_Ease_In_Quart Ease in quart.
  • RLPy.ETransitionType_Ease_Out_Quart Ease out quart.
  • RLPy.ETransitionType_Ease_In_Out_Quart Ease in out quart.
  • RLPy.ETransitionType_Ease_In_Quint Ease in quint.
  • RLPy.ETransitionType_Ease_Out_Quint Ease out quint.
  • RLPy.ETransitionType_Ease_In_Out_Quint Ease in out quint.
  • RLPy.ETransitionType_Ease_In_Expo Ease in expo.
  • RLPy.ETransitionType_Ease_Out_Expo Ease out expo.
  • RLPy.ETransitionType_Ease_In_Out_Expo Ease in out expo.
  • RLPy.ETransitionType_Ease_In_Circ Ease in circ.
  • RLPy.ETransitionType_Ease_Out_Circ Ease out circ.
  • RLPy.ETransitionType_Ease_In_Out_Circ Ease in out circ.
  • RLPy.ETransitionType_Ease_In_Back Ease in back.
  • RLPy.ETransitionType_Ease_Out_Back Ease out back.
  • RLPy.ETransitionType_Ease_In_Out_Back Ease in out back.
  • RLPy.ETransitionType_Ease_In_Elastic Ease in elastic.
  • RLPy.ETransitionType_Ease_Out_Elastic Ease out elastic.
  • RLPy.ETransitionType_Ease_In_Out_Elastic Ease in out elastic.
  • RLPy.ETransitionType_Ease_In_Bounce Ease in bounce.
  • RLPy.ETransitionType_Ease_Out_Bounce Ease out bounce.
  • RLPy.ETransitionType_Ease_In_Out_Bounce Ease in out bounce.
  • RLPy.ETransitionType_Last Last.
  • RLPy.ETransitionType_Count
1 # No example

RLPy.RIClip.GetType(self)

Get type of the clip.

Returns

clip type - int

1 # No example

RLPy.RIClip.SceneTimeToClipTime(self, kSceneTick)

Convert Scene time to clip time.

Parameters

kSceneTime[IN] Scene time.

Returns

clip time - RLPy.RLTime

 1 # Get skeleton component
 2 avatar_list = RLPy.RScene.GetAvatars()
 3 avatar = avatar_list[0]
 4 bone = avatar.GetSkeletonComponent()
 5 
 6 # Scene time to clip time
 7 clip_index = 1
 8 clip = bone.GetClip(clip_index)
 9 scene_time = RLPy.RTime(13000)
10 clip_time = clip.SceneTimeToClipTime(scene_time)

RLPy.RIClip.SetLength(self, kLength)

Set length of the clip.

Parameters

kLength[IN] clip length - RLPy.RLTime

Returns

RLPy.RStatus.Success - Succeed
RLPy.RStatus.Failure - Fail
 1 # Get skeleton component
 2 avatar_list = RLPy.RScene.GetAvatars()
 3 avatar = avatar_list[0]
 4 bone = avatar.GetSkeletonComponent()
 5 
 6 # Set clip length
 7 clip_index = 1
 8 clip = bone.GetClip(clip_index)
 9 clip_len = RLPy.RTime(2000)
10 clip.SetLength(clip_len)

RLPy.RIClip.SetSpeed(self, fSpeed)

set the speed of the clip

Parameters

fSpeed[IN] speed of the clip - float

Returns

RLPy.RStatus.Success - Succeed
RLPy.RStatus.Failure - Fail
1 # No example

RLPy.RIClip.SetTransitionData(self, kData)

Modify the transition time.

Returns

kData [IN] list of the transition time [fade-in start, fade-in end, fade-out start, fade-out end] - RLPy.RStatus

Returns

RLPy.RStatus.Success - Succeed
RLPy.RStatus.Failure - Fail
1 # No example

RLPy.RIClip.SetTransitionRange(self, kLength)

Modify the fade-in transition time.

Parameters

kLength[IN] length of transition time - RLPy.RLTime

Returns

RLPy.RStatus.Success - Succeed
RLPy.RStatus.Failure - Fail
1 # No example

RLPy.RIClip.SetTransitionType(self, bFadeIn, eTransitionType, fTransitionStrength)

Set transition type of the clip.

Parameters

bFadeIn[IN] true: fade-in, false: fade-out - bool
eTransitionType[IN] Transition type of the clip - RLPy.ETransitionType
  • RLPy.ETransitionType_Invalid Invalid value.
  • RLPy.ETransitionType_None None.
  • RLPy.ETransitionType_Linear Linear.
  • RLPy.ETransitionType_Step Step.
  • RLPy.ETransitionType_Ease_Out Ease out.
  • RLPy.ETransitionType_Ease_In Ease in.
  • RLPy.ETransitionType_Ease_Out_In Ease out in.
  • RLPy.ETransitionType_Ease_In_Out Ease in out.
  • 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 quad.
  • RLPy.ETransitionType_Ease_Out_Quad Ease out quad.
  • RLPy.ETransitionType_Ease_In_Out_Quad Ease in out quad.
  • RLPy.ETransitionType_Ease_In_Cubic Ease in cubic.
  • RLPy.ETransitionType_Ease_Out_Cubic Ease in out cubic.
  • RLPy.ETransitionType_Ease_In_Out_Cubic Ease in out cubic.
  • RLPy.ETransitionType_Ease_In_Quart Ease in quart.
  • RLPy.ETransitionType_Ease_Out_Quart Ease out quart.
  • RLPy.ETransitionType_Ease_In_Out_Quart Ease in out quart.
  • RLPy.ETransitionType_Ease_In_Quint Ease in quint.
  • RLPy.ETransitionType_Ease_Out_Quint Ease out quint.
  • RLPy.ETransitionType_Ease_In_Out_Quint Ease in out quint.
  • RLPy.ETransitionType_Ease_In_Expo Ease in expo.
  • RLPy.ETransitionType_Ease_Out_Expo Ease out expo.
  • RLPy.ETransitionType_Ease_In_Out_Expo Ease in out expo.
  • RLPy.ETransitionType_Ease_In_Circ Ease in circ.
  • RLPy.ETransitionType_Ease_Out_Circ Ease out circ.
  • RLPy.ETransitionType_Ease_In_Out_Circ Ease in out circ.
  • RLPy.ETransitionType_Ease_In_Back Ease in back.
  • RLPy.ETransitionType_Ease_Out_Back Ease out back.
  • RLPy.ETransitionType_Ease_In_Out_Back Ease in out back.
  • RLPy.ETransitionType_Ease_In_Elastic Ease in elastic.
  • RLPy.ETransitionType_Ease_Out_Elastic Ease out elastic.
  • RLPy.ETransitionType_Ease_In_Out_Elastic Ease in out elastic.
  • RLPy.ETransitionType_Ease_In_Bounce Ease in bounce.
  • RLPy.ETransitionType_Ease_Out_Bounce Ease out bounce.
  • RLPy.ETransitionType_Ease_In_Out_Bounce Ease in out bounce.
  • RLPy.ETransitionType_Last Last.
  • RLPy.ETransitionType_Count
fTransitionStrength[IN] Transition strength of the clip (0~100) - float

Returns

RLPy.RStatus.Success - Succeed
RLPy.RStatus.Failure - Fail
1 # No example