AddClipRelation
 
 
 

AddClipRelation

Introduced

v4.0

Description

Creates a master-slave relation between two clips. By default the relation binds the Start Offset, Clip In and Clip Out of the TimeControl object for the two Clip objects.

Scripting Syntax

oReturn = AddClipRelation( [From], [To], [Name] );

Return Value

Returns the relation (a ClipRelation object).

Parameters

Parameter Type Description
From The Clip object itself or its object name The master clip of the relation.

Default Value: Current selection. If nothing is selected, a pick session starts.

To The Clip object itself or its object name The slave clip of the relation.

Default Value: Current selection. If nothing is selected, a pick session starts.

Name String New name for the ClipRelation.

Default Value: "Relation"

Examples

JScript Example

/*
        This example shows how to create a ClipRelation using the AddClipRelation command.
*/
NewScene(null, false);
// Set up the scene with a cone and then store its translation as a static pose
CreatePrim("Cone", "MeshSurface", null, null);
Translate(null, 5.57429595406375, 0.195303936039821, -1.95303936039821E-02, 
        siRelative, siView, siObj, siXYZ, null, null, siXYZ, 
        null, null, null, null, null, null, 0);
var sParams = "cone.kine.local.sclx,cone.kine.local.scly,cone.kine.local.sclz"
        + ",cone.kine.local.rotx,cone.kine.local.roty,cone.kine.local.rotz"
        + ",cone.kine.local.posx,cone.kine.local.posy,cone.kine.local.posz";
StoreAction(null, sParams, 1, "StoredStaticPose", true, 1, 5, false, false);
SelectObj("cone", null, true);
// Set up the mixer with two tracks and add the pose to both tracks at different frames
AddTrack("Scene_Root", "Scene_Root", 0, null, null);
AddTrack("Scene_Root", "Scene_Root", 0, null, null);
AddClip("Scene_Root", "Sources.Scene_Root.StoredStaticPose", null, 
        "Mixer.Mixer_Anim_Track", 19, null, null, null, null);
AddClip("Scene_Root", "Sources.Scene_Root.StoredStaticPose", null, 
        "Mixer.Mixer_Anim_Track1", 47, null, null, null, null);
// Set up a master-slave relation between the two clips
AddClipRelation("Mixer.Mixer_Anim_Track.StoredStaticPose_Clip", 
        "Mixer.Mixer_Anim_Track1.StoredStaticPose_Clip1", null);