Mel - Maya Embedded Language

<HOME>   <PREVIOUS>   <NEXT>

Functions

Limit       Exponential       Trigometric       Vector       Conversion       Random   

Maya has many built in functions that can be used to obtain information. To use a function typically you would use it in an assignment statement like:

     $myBall=funtionName(send it something);

Limit Functions
abs
Operation: absolute value Supported Data types: int float vector int abs(int number) float abs(float number) vector abs(vector number) Example: abs(-1); returns 1
ceil
Operation: round to the smallest integer value greater than or equal to a float value Supported Data types: float float ceil(float number) Example: ceil(2.344); returns 3
floor
Operation: round to the largest integer value smaller than or equal to a float value Supported Data types: float float floor(float number) Example: floor(2.344); returns 2
clamp
Operation: Returns a number within a range. use to confine a changing number to a range. Supported Data types: float float clamp(float minnumber, float maxnumber, float parameter) Example: clamp(4,6,22);returns 6 clamp(4,6,2); returns 4
min
Operation: Returns the lesser of two floating point numbers. Supported Data types: float float min( float number, float number) Example: min(7, -10.1); returns -10.1
max
Operation: Returns the larger of two floating point numbers Supported Data types: float float max(float number, float number) Example: max(4, -10.1); returns 4
sign
Operation: Returns one of three values representing the sign of a number. Returns -1 if the number is negative, 1 if positive, 0 if 0. Supported Data types: float float sign( float number ) Example: sign(ball.translateX); where tx = 5 returns 1
trunc
Operation: Returns the whole number part of a floating point number Supported Data types: float float trunc(float number) Example: trunc(51.995);returns 51