KeyframeTrackSet.kl

Types

KeyframeTrackSet (object)

A collection of tracks driving a single value.

The KeyframeTrackSet groups a collection of tracks together to drive the value of a Math type, such as Scalar, Vec2, :kl-ref:`Vec3, Vec4, Quat, Euler or Xfo. A KeyframeTrackSet can contain zero or many tracks, each generated based on the specified Math type.

KeyframeTrackSets are often bundled into Clips, which group together many values into a container that can drive the animation of a character.

/*
** Example: keyframeTrackSet.kl
*/

require Animation;

operator entry(){

    KeyframeTrackSet vec3TrackSet = KeyframeTrackSet('Vec3TrackSet', Vec3(0.4, 1.2, 2.4), 0);

    vec3TrackSet.setTrackValues(0.0, Vec3(0.0, 0.0, 0.0));
    vec3TrackSet.setTrackValues(3.0, Vec3(1.0, 2.0, 0.0));
    vec3TrackSet.setTrackValues(7.0, Vec3(0.0, 2.0, 3.0));

    Integer keyIndices[];
    Vec3 value;
    for(Integer i=0; i<=20; i++){
        Scalar time = Math_linearInterpolate(0.0, 4.0, Scalar(i)/20.0);
        vec3TrackSet.evaluate(time, value, keyIndices);
        report("time:" + time + " value:" + value);
    }
}

/*
** Output:

time:+0.0 value:{x:+0.0,y:+0.0,z:+0.0}
time:+0.2 value:{x:+0.066666,y:+0.133333,z:+0.0}
time:+0.4 value:{x:+0.133333,y:+0.266666,z:+0.0}
time:+0.6 value:{x:+0.2,y:+0.4,z:+0.0}
time:+0.8 value:{x:+0.266666,y:+0.533333,z:+0.0}
time:+1.0 value:{x:+0.333333,y:+0.666666,z:+0.0}
time:+1.2 value:{x:+0.4,y:+0.8,z:+0.0}
time:+1.4 value:{x:+0.466666,y:+0.933333,z:+0.0}
time:+1.6 value:{x:+0.533333,y:+1.066666,z:+0.0}
time:+1.8 value:{x:+0.599999,y:+1.199999,z:+0.0}
time:+2.0 value:{x:+0.666666,y:+1.333333,z:+0.0}
time:+2.2 value:{x:+0.733333,y:+1.466666,z:+0.0}
time:+2.4 value:{x:+0.8,y:+1.6,z:+0.0}
time:+2.6 value:{x:+0.866666,y:+1.733333,z:+0.0}
time:+2.8 value:{x:+0.933333,y:+1.866666,z:+0.0}
time:+3.0 value:{x:+1.0,y:+2.0,z:+0.0}
time:+3.2 value:{x:+0.95,y:+2.0,z:+0.15}
time:+3.4 value:{x:+0.9,y:+2.0,z:+0.3}
time:+3.6 value:{x:+0.85,y:+2.0,z:+0.449999}
time:+3.8 value:{x:+0.8,y:+2.0,z:+0.599999}
time:+4.0 value:{x:+0.75,y:+2.0,z:+0.75}

*/

Members

String name  
String valueType  
UInt32 flags  
KeyframeTrack[] tracks  

Methods

  KeyframeTrackSet ( in KeyframeTrackSet other )
  KeyframeTrackSet ( in String name, in Color color, in Scalar defaultValue, in UInt32 flags )
  KeyframeTrackSet ( in String name, in Euler defaultValue, in UInt32 flags )
  KeyframeTrackSet ( in String name, in Quat defaultValue, in UInt32 flags )
  KeyframeTrackSet ( in String name, in UInt32 flags )
  KeyframeTrackSet ( in String name, in Vec2 defaultValue, in UInt32 flags )
  KeyframeTrackSet ( in String name, in Vec3 defaultValue, in UInt32 flags )
  KeyframeTrackSet ( in String name, in Vec4 defaultValue, in UInt32 flags )
  KeyframeTrackSet ( in String name, in Xfo defaultValue, in UInt32 flags )
  KeyframeTrackSet ()
  addTrack ! ( in IKeyframeTrack track )
Integer addTrack ! ( in String name, in Color color, in Scalar defaultValue )
  clear ! ()
  clearTracks ! ()
KeyframeTrackSet clone ? ()
  evaluate ? ( in Scalar time, out Euler value, out Integer keyIndices[] )
  evaluate ? ( in Scalar time, out Quat value, out Integer keyIndices[] )
  evaluate ? ( in Scalar time, out Scalar value, out Integer keyIndices[] )
  evaluate ? ( in Scalar time, out Scalar values[], out Integer keyIndices[] )
  evaluate ? ( in Scalar time, out Vec2 value, out Integer keyIndices[] )
  evaluate ? ( in Scalar time, out Vec3 value, out Integer keyIndices[] )
  evaluate ? ( in Scalar time, out Vec4 value, out Integer keyIndices[] )
  evaluate ? ( in Scalar time, out Xfo value, out Integer keyIndices[] )
Integer findTrack ? ( in String name )
String getDesc ? ( in String indent, in Boolean includeTracks )
String getDesc ? ()
UInt32 getFlags ? ()
String getName ? ()
UInt32 getNumTracks ? ()
Vec2 getTimeRange ? ()
IKeyframeTrack getTrack ? ( in String name )
IKeyframeTrack getTrack ? ( in UInt32 index )
String[] getTrackNames ? ()
String getValueType ? ()
  setFlag ! ( in UInt32 flag )
  setTrack ! ( in String name, in IKeyframeTrack track )
  setTrackValues ! ( in Scalar time, in Quat value )
  setTrackValues ! ( in Scalar time, in Scalar value )
  setTrackValues ! ( in Scalar time, in Vec2 value )
  setTrackValues ! ( in Scalar time, in Vec3 value )
  setTrackValues ! ( in Scalar time, in Vec4 value )
  setTrackValues ! ( in Scalar time, in Xfo value )
Boolean testFlag ? ( in UInt32 flag )