Apple Shake 4 User Manual
Page 945
![background image](/manuals/547483/945/background.png)
Chapter 31
Expressions and Scripting
945
Curve Functions
The curve functions with implicit time (Linear, CSpline, and so on.) all assume that time
is the first argument, so the following statements are identical:
LinearV(time,0,1@1,20@20)
Linear(0,1@1,20@20)
You can, however, adjust the time value explicitly with the V version of each curve type.
For more information on spline types, see “
These are the cycle type codes:
•
0 = KeepValue
•
1 = KeepSlope
•
2 = RepeatValue
•
3 = MirrorValue
•
4 = OffsetValue
String Functions
Definition
stringf( “xyz”, ...)
Since you basically can write books on this, here is an example.
Otherwise, it is recommended to purchase a book on C. There are
also several examples in Chapter 30, “
,” on page 905. This example takes the scriptName
parameter and uses the system function echo to print it:
extern “C” int system(const char*);
const char *z= stringf(“echo %s”,scriptName);
system(z);
printf( “xyz”, ...)
strlen(“mystring”)
Returns the length of the string.
strsub(
const char *string,
int offset,
int length
Extracts a string from another string.
Curve Functions
Definition
biasedGain(x,gain,bias)
Gives a smoothly-ramped interpolation between 0 and 1, similar to
Shake’s contrast curve. Gain increases the contrast, and bias offsets
the center.
Linear(cycle,
value@key1,
value@key2,
...)
Linear interpolation from value at keyframe 1 to value at keyframe
2, and so on.
LinearV(time_value, cycle,
value@key1,
value@key2,
...)
Linear interpolation from value at keyframe 1 to value at keyframe
2, and so on.