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);

Random Functions
gauss
Operation: Returns a random floating point number or vector. The number returned falls within a Gaussian (bell curve) distribution with mean value 0 Supported Data types: float, vector float gauss(float stdDev) vector gauss(float XstdDev, float YstdDev) vector gauss(vector stdDevVector) Example: gauss(5)
noise
Operation: Returns a random number from -1 to 1 according to a Perlin noise field generator. Supported Data types: float float noise(float number) float noise(float xnum, float ynum) float noise(vector vector) Example: noise(time)
dnoise
Operation: Returns a vector with each component containing a random number from -1 to 1 Supported Data types: vector vector dnoise(vector argument) Example: dnoise(<<10,20,-30>>) Returns <<-0.184902, 0.440937, 0.685714>>
rand
Operation: Returns a random floating point number or vector within a range of your choice Supported Data types: float, vector float rand(float maxnumber) float rand(float minnumber, float maxnumber) vector rand(vector maxvector) vector rand(vector minvector, vector maxvector) Example: rand(5)
sphrand
Operation: Returns a random vector value that exists within a spherical or ellipsoidal region of your choice. An ellipsoid is a sphere scaled along its X-, Y- or Z-axes. Supported Data types: Vector vector sphrand(float radius) vector sphrand(vector vector) Example: sphrand(<<2,1,1>>) or sphrand(5)
seed
Operation: Sets a seed value the gauss, rand, and sphrand functions use to generate random numbers Supported Data types: int int seed(int number) Example: if (frame == 1) seed(500); Ball.translateX = rand(5);