ClipValues (object)¶
The ClipValues stores sets clip values, keyed by name. The Clip values is used as an intermediate container to store animation data generated by the evaluation of Clips.
参考
Clip, TrackSet
/*
** Example: clipValues.kl
*/
require Animation;
operator entry(){
ClipValues clipValues1();
clipValues1.setScalarValue('ScalarValue', 1.2);
clipValues1.setVec2Value('Vec2Value', Vec2(0.4, 1.2));
clipValues1.setVec3Value('Vec3Value', Vec3(0.4, 1.2, 2.4));
clipValues1.setVec4Value('Vec4Value', Vec4(0.4, 1.2, 2.4, 5.7));
clipValues1.setQuatValue('QuatValue', Quat());
clipValues1.setXfoValue('XfoValue', Xfo(Vec3(1.5, 2.5, 0.3)));
ClipValues clipValues2();
clipValues2.setScalarValue('ScalarValue', 2.6);
clipValues2.setVec2Value('Vec2Value', Vec2(5.1, 1.7));
clipValues2.setVec3Value('Vec3Value', Vec3(5.1, 1.7, 9.3));
clipValues2.setVec4Value('Vec4Value', Vec4(5.1, 1.7, 9.3, 0.3));
clipValues2.setQuatValue('QuatValue', Quat());
clipValues2.setXfoValue('XfoValue', Xfo(Vec3(2.5, 4.7, 8.3)));
report(clipValues1.subtract(clipValues2).getDesc());
report(clipValues1.linearInterpolate(clipValues2, 0.45).getDesc());
report(clipValues1.addWeighted(clipValues2, 0.6).getDesc());
}
/*
** Output:
ClipValues:{
ScalarValue=-1.399902
Vec2Value={x:-4.700195,y:-0.5}
Vec3Value={x:-4.700195,y:-0.5,z:-6.90039}
Vec4Value={x:-4.700195,y:-0.5,z:-6.90039,t:+5.40039}
QuatValue={v:{x:+0.0,y:+0.0,z:+0.0},w:+1.0}
XfoValue={tr:{x:-1.0,y:-2.200195,z:-8.0},ori:{v:{x:+0.0,y:+0.0,z:+0.0},w:+1.0},sc:{x:+1.0,y:+1.0,z:+1.0}}
}
ClipValues:{
ScalarValue=+1.830078
Vec2Value={x:+2.515136,y:+1.425048}
Vec3Value={x:+2.515136,y:+1.425048,z:+5.504883}
Vec4Value={x:+2.515136,y:+1.425048,z:+5.504883,t:+3.270019}
QuatValue={v:{x:+0.0,y:+0.0,z:+0.0},w:+1.0}
XfoValue={tr:{x:+1.949951,y:+3.490234,z:+3.899902},ori:{v:{x:+0.0,y:+0.0,z:+0.0},w:+1.0},sc:{x:+1.0,y:+1.0,z:+1.0}}
}
ClipValues:{
ScalarValue=+2.759765
Vec2Value={x:+3.459961,y:+2.220214}
Vec3Value={x:+3.459961,y:+2.220214,z:+7.980469}
Vec4Value={x:+3.459961,y:+2.220214,z:+7.980469,t:+5.879883}
QuatValue={v:{x:+0.0,y:+0.0,z:+0.0},w:+1.0}
XfoValue={tr:{x:+3.0,y:+5.320312,z:+5.280273},ori:{v:{x:+0.0,y:+0.0,z:+0.0},w:+1.0},sc:{x:+1.0,y:+1.0,z:+1.0}}
}
*/
Members¶
ScalarValue[String] | scalarValues | |
Vec2Value[String] | vec2Values | |
Vec3Value[String] | vec3Values | |
Vec4Value[String] | vec4Values | |
QuatValue[String] | quatValues | |
XfoValue[String] | xfoValues |
Methods¶
ClipValues ( in ClipValues other ) | |
ClipValues () | |
addWeighted ! ( in ClipValues other, in Scalar weight ) | |
ClipValues | clone ? () |
cloneMembersTo ? ( io ClipValues that ) | |
String | getDesc ? () |
Quat | getQuatValue ? ( in String name ) |
Scalar | getScalarValue ? ( in String name ) |
Vec2 | getVec2Value ? ( in String name ) |
Vec3 | getVec3Value ? ( in String name ) |
Vec4 | getVec4Value ? ( in String name ) |
Xfo | getXfoValue ? ( in String name ) |
Boolean | hasQuatValue ? ( in String name ) |
Boolean | hasScalarValue ? ( in String name ) |
Boolean | hasVec2Value ? ( in String name ) |
Boolean | hasVec3Value ? ( in String name ) |
Boolean | hasVec4Value ? ( in String name ) |
Boolean | hasXfoValue ? ( in String name ) |
ClipValues | linearInterpolate ? ( in ClipValues other, in Scalar t ) |
setQuatValue ! ( in String name, in Quat value ) | |
setQuatValue ! ( in String name, in Quat value, in UInt32 flags ) | |
setScalarValue ! ( in String name, in Scalar value ) | |
setScalarValue ! ( in String name, in Scalar value, in UInt32 flags ) | |
setVec2Value ! ( in String name, in Vec2 value ) | |
setVec2Value ! ( in String name, in Vec2 value, in UInt32 flags ) | |
setVec3Value ! ( in String name, in Vec3 value ) | |
setVec3Value ! ( in String name, in Vec3 value, in UInt32 flags ) | |
setVec4Value ! ( in String name, in Vec4 value ) | |
setVec4Value ! ( in String name, in Vec4 value, in UInt32 flags ) | |
setXfoValue ! ( in String name, in Xfo value ) | |
setXfoValue ! ( in String name, in Xfo value, in UInt32 flags ) | |
ClipValues | subtract ? ( in ClipValues other ) |
Methods in detail¶
ClipValues ( in ClipValues other )
copy constructor
ClipValues ()
default constructor
ClipValues.addWeighted! ( in ClipValues other, in Scalar weight )
Adds the given ClipValues onto this one, modifying its values
other | The ClipValues to add |
t | The weight to use when adding the other values. |
ClipValues ClipValues.clone? ()
clone method
ClipValues.cloneMembersTo? ( io ClipValues that )
Returns a clone of the ClipValues.
String ClipValues.getDesc? ()
Generates a Description string of this ClipValues.
indent | The indentation to use when generating the string. |
Quat ClipValues.getQuatValue? ( in String name )
Returns the Quat value with the given name
name | The name of the value to return |
Scalar ClipValues.getScalarValue? ( in String name )
Returns the Scalar value with the given name
name | The name of the value to return |
Vec2 ClipValues.getVec2Value? ( in String name )
Returns the Vec2 value with the given name
name | The name of the value to return |
Vec3 ClipValues.getVec3Value? ( in String name )
Returns the Vec3 value with the given name
name | The name of the value to return |
Vec4 ClipValues.getVec4Value? ( in String name )
Returns the Vec4 value with the given name
name | The name of the value to return |
Xfo ClipValues.getXfoValue? ( in String name )
Returns the Xfo value with the given name
name | The name of the value to return |
Boolean ClipValues.hasQuatValue? ( in String name )
Returns true if the given Quat value is stored in the ClipValues
name | The name of the value to check |
Boolean ClipValues.hasScalarValue? ( in String name )
Returns true if the given Scalar value is stored in the ClipValues
name | The name of the value to check |
Boolean ClipValues.hasVec2Value? ( in String name )
Returns true if the given Vec2 value is stored in the ClipValues
name | The name of the value to check |
Boolean ClipValues.hasVec3Value? ( in String name )
Returns true if the given Vec3 value is stored in the ClipValues
name | The name of the value to check |
Boolean ClipValues.hasVec4Value? ( in String name )
Returns true if the given Vec4 value is stored in the ClipValues
name | The name of the value to check |
Boolean ClipValues.hasXfoValue? ( in String name )
Returns true if the given Xfo value is stored in the ClipValues
name | The name of the value to check |
ClipValues ClipValues.linearInterpolate? ( in ClipValues other, in Scalar t )
Returns a new ClipValues whose values are the interpolation of this ClipValues with the given ClipValues
other | The ClipValues to interpolate towards |
t | The parameter for the interpolation |
ClipValues.setQuatValue! ( in String name, in Quat value )
Sets a Quat value to the ClipValues struct.
name | The name of the value to set |
value | The value to set |
ClipValues.setQuatValue! ( in String name, in Quat value, in UInt32 flags )
Sets a Quat value to the ClipValues struct.
name | The name of the value to set |
value | The value to set |
flags | The flags to set with the value. Normally the values stored with the KeyframeTrackSet |
ClipValues.setScalarValue! ( in String name, in Scalar value )
Sets a Scalar value to the ClipValues struct.
name | The name of the value to set |
value | The value to set |
ClipValues.setScalarValue! ( in String name, in Scalar value, in UInt32 flags )
Sets a Scalar value to the ClipValues struct.
name | The name of the value to set |
value | The value to set |
flags | The flags to set with the value. Normally the values stored with the KeyframeTrackSet |
ClipValues.setVec2Value! ( in String name, in Vec2 value )
Sets a Vec2 value to the ClipValues struct.
name | The name of the value to set |
value | The value to set |
ClipValues.setVec2Value! ( in String name, in Vec2 value, in UInt32 flags )
Sets a Vec2 value to the ClipValues struct.
name | The name of the value to set |
value | The value to set |
flags | The flags to set with the value. Normally the values stored with the KeyframeTrackSet |
ClipValues.setVec3Value! ( in String name, in Vec3 value )
Sets a Vec3 value to the ClipValues struct.
name | The name of the value to set |
value | The value to set |
ClipValues.setVec3Value! ( in String name, in Vec3 value, in UInt32 flags )
Sets a Vec3 value to the ClipValues struct.
name | The name of the value to set |
value | The value to set |
flags | The flags to set with the value. Normally the values stored with the KeyframeTrackSet |
ClipValues.setVec4Value! ( in String name, in Vec4 value )
Sets a Vec4 value to the ClipValues struct.
name | The name of the value to set |
value | The value to set |
ClipValues.setVec4Value! ( in String name, in Vec4 value, in UInt32 flags )
Sets a Vec4 value to the ClipValues struct.
name | The name of the value to set |
value | The value to set |
flags | The flags to set with the value. Normally the values stored with the KeyframeTrackSet |
ClipValues.setXfoValue! ( in String name, in Xfo value )
Sets a Xfo value to the ClipValues struct.
name | The name of the value to set |
value | The value to set |
ClipValues.setXfoValue! ( in String name, in Xfo value, in UInt32 flags )
Sets a Xfo value to the ClipValues struct.
name | The name of the value to set |
value | The value to set |
flags | The flags to set with the value. Normally the values stored with the KeyframeTrackSet |
ClipValues ClipValues.subtract? ( in ClipValues other )
Returns a new ClipValues whose values are the subtraction of the given ClipValues from this ClipValues
other | The ClipValues to subtract |