MergeClips
 
 
 

MergeClips

Introduced

v2.0

Description

Create a new source that contains a copy of the keys of each fcurve in the selected clips. This is similar to a plot, except that the data is not generated with a key at every frame.

Note: Clips should not overlap, or be weighted against other clips, or have timewarps. Only works with FCurve and static value items.

Scripting Syntax

oReturn = MergeClips( InputObjs );

Return Value

Returns the new ActionSource created.

Parameters

Parameter Type Description
InputObjs String List of clips to merge.

Default Value: Current selection

Examples

VBScript Example

' This example creates three clips on a track.  Then
' it merges the data (static values and fcurve keys)
' from those three sources into a new source Action.
' Finally it instantiates this merged Action onto the
' mixer.
option explicit
dim oSph, strParams, oTrack(1), oAct(2), oClip(2), oMerged
' Create an object for us to play with.
strParams = "/kine.local.posx,kine.local.posy,kine.local.posz"
NewScene , False
set oSph = CreatePrim( "Sphere", "MeshSurface" )
' Create an Action containing fcurve sources.
Translate oSph, -6, 4, 0, siAbsolute, siParent, siObj, siXYZ
SaveKey oSph & strParams, 1
Translate oSph, -8, -6, 0, siAbsolute, siParent, siObj, siXYZ
SaveKey oSph & strParams, 10
Translate oSph, 6, -4, 0, siAbsolute, siParent, siObj, siXYZ
SaveKey oSph & strParams, 20
set oAct(0) = StoreAction( , oSph & strParams, 2, "StoredFcvPose", True, 1, 20, False, False )
' Create a couple of Actions with static (snapshot) sources.
Translate oSph, 8, 6, 0, siAbsolute, siParent, siObj, siXYZ
set oAct(1) = StoreAction( , oSph & strParams, 1, "StoredStaticAction", True, 1, 1, False, False )
Translate oSph, 0, 0, -10, siAbsolute, siParent, siObj, siZ
set oAct(2) = StoreAction( , oSph & strParams, 1, "StoredStaticAction", True, 1, 1, False, False )
' Instantiate these three Actions on the mixer.
set oTrack(0) = AddTrack( "Scene_Root", "Scene_Root", 0 )
set oClip(0) = AddClip( "Scene_Root", oAct(1), , oTrack(0), 5, , , , False )
set oClip(1) = AddClip( "Scene_Root", oAct(0), , oTrack(0), 15, , , , False )
set oClip(2) = AddClip( "Scene_Root", oAct(2), , oTrack(0), 45, , , , False )
' Merge together the three clips into a new Action.
set oMerged = MergeClips( oClip(0) & "," & oClip(1) & "," & oClip(2) )
' Finally, add this as a new clip, muting the first track.
SetValue oTrack(0) & ".mute", True
set oTrack(1) = AddTrack( "Scene_Root", "Scene_Root", 0 )
AddClip "Scene_Root", oMerged, , oTrack(1), 5, , , , False