ScriptFunctions のバックアップ差分(No.1)


  • 追加された行はこの色です。
  • 削除された行はこの色です。
''Script-Functions:''

The input and output of these functions are not clips, but some other variables used in the script.

**Numeric Functions: [#u1ee7bc9]

 Floor(float)

Converts from float to int (round down on any fractional amount).

''Examples:''

 Floor(1.2) = 1 
 Floor(1.6) = 1 
 Floor(-1.2) = -2 
 Floor(-1.6) = -2 

#hr

 Ceil(float)

Converts from float to int (round up on any fractional amount).

''Examples:''

 Ceil(1.2) = 2.0 
 Ceil(1.6) = 2.0 
 Ceil(-1.2) = -1 
 Ceil(-1.6) = -1 

#hr

 Round(float)

Converts from float to int (round off to nearest integer).

''Examples:''

 Round(1.2) = 1 
 Round(1.6) = 2 
 Round(-1.2) = -1 
 Round(-1.6) = -2 

#hr

 Sin(float) v2

#hr

 Cos(float) v2

#hr

 Pi() v2

#hr

 Log(float) v2

#hr

 Exp(float) v2

#hr

 Pow(float base, float power) v2

#hr

 Sqrt(float) v2

#hr

 Abs(float or integer) v2.07

Returns the absolute value (returns float for float, integer for integer).

''Example:''

 Abs(-3.8) = 3.8 

#hr

 Sign(float) v2.07

Returns sign of value (1, 0 or -1).

''Examples:''

 Sign(-3.5) = -1 
 Sign(3.5) = 1 
 Sign(0) = 0 

#hr

 Int(float) v2.07

Converts from float to int (round towards zero).

''Examples:''

 Int(1.2) = 1 
 Int(1.6) = 1 
 Int(-1.2) = -1 
 Int(-1.6) = -1 

#hr

 Frac(float) v2.07

Returns the fractional portion of the value provided.

''Examples:''

 Frac(3.7) = 0.7 
 Frac(-1.8) = -0.8 

#hr

 Float(int) v2.07

Converts int to float.

#hr

 Value(string) v2.07

Converts string to numeric value.

#hr

 HexValue(string) v2.07

Evaluates string as hexadecimal value.

''Example:''

 HexValue ("FF00") = 65280

#hr

 Rand([int max] [, bool scale] [, bool seed]) v2.07

Returns a random integer value and all parameters are optional. Max sets the maximum value+1 (default 32768) and can be set negative for negative results. It operates either in scaled or modulus mode (default scale=true only if abs(max) > 32768, false otherwise). Scaled mode scales the internal random number generator value to the maximum value, while modulus mode (scale=false) uses the remainder from an integer divide of the random generator value by the maximum. I found modulus mode is best for smaller maximums. Using Seed=true seeds the random number generator with the current time and defaults to false and probably isn't necessary, although it's there just in case. Typically, this function would be used with the Select function for random clips.

''Example:''

 Select(Rand(5), clip1, clip2, clip3, clip4, clip5) 

#hr

 Spline(float X, x1, y1, x2, y2, .... [, bool cubic]) v2.51

Interpolates the Y value at point X using the control points x1/y1, ... There have to be at least 2 x/y-pairs. The interpolation can be cubic (the result is a spline) or linear (the result is a polygon).

''Examples:''

 Spline(5, 0, 0, 10, 10, 20, 0, false) = 5 
 Spline(5, 0, 0, 10, 10, 20, 0, true) = 7