{
abs number
This is a mathematical function used to express the absolute
value of the number.

	i.e. abs (-2.6)=2.6

}

{
acos number
This is a trigonometric mathematical function used to express
the arccosine value of the number.

	i.e. acos (0)=90

}

{
arg line argNum
This function extracts an argument from a line. The example
below will extract the time out of the date string returned
by the system function.

	i.e arg (system(date), 3)=20:17:46

}

{
argc line
Returns the number of arguments in the line. Counts the number
of arguments in the line.  Standard parsing is done, no variable
expansion is done on the line.

	i.e. argc("This has four arguments")=4

}

{
arm name sop_num string
This function will extract inverse kinematic rotations from an arm sop.
This is useful for creating hierarchical systems that mimic the arm.
The object name is the name of the object containing an arm sop.
The sop_num is the number of the arm sop within the object.
The string is one of: nrx, nry, arx, ury, hrx, hry, hrz
The string is one of: Hrx, Hry, Hrz, Htx, Hty, Htz
The string name is an indication of the object and channel that the
returned rotation is meant to be placed in, where:
	n=null, a=humerous, u=ulna, h=hand
null oxorder should be yx, hand should be xyz

	i.e. arm (rarm, 1, nrx)

}

{
asin number
This is a trigonometric mathematical function used to express
the arcsine value of the number.

	i.e. asin (.866025)=60

}

{
atan number
This is a trigonometric mathematical function used to express
the arctangent value of the number.

	i.e. atan (1.73205)=60

}

{
atan2 y x
Compute the arctangent of y/x.  This is more stable than atan() since
it can use the signs of y and x to determine the quadrant the angle
is in.  It also handles the case where x is zero correctly, returning
90 or -90.

	i.e. atan2(1, 0) = 90
	     atan2(0, 1) = 0
	     atan2(0, -1) = 180

}

{
beat keyname parameter
Get the value attached to one of the keyboard keys.  The first argument
is the key name, including the 0 to 9 keys, named KEY0 to KEY9, the A
to Z keys named KEYA to KEYZ, and the key pad keys named KEYPAD0 to
KEYPAD9.  The second argument is the parameter to retrieve:  VAL,
SPEED, BINARY, ANALOG, TICK, COUNT, PERIOD, CYCLE.

}

{
bezier
This is a channel expression that yields a bezier interpolation spline.

}

{
clamp value minimum maximum
This is an Action expression function that will clamp the value
between the minimum and maximum numbers. It is used to prevent
the value from going outside the specified range.

	i.e. If the value is less than the minimum number, the
	minimum number will be returned. If the value is greater
	than the maximum number, the maximum number will be returned.

}

{
ch name channel
Will evaluate the channel of the object specified 

see also: chf

}

{
chf name channel frame
Will evaluate the channel of the object at the frame specified.

see also: ch

}

{
chname objectName type
Will return the name of the channel of the object of the specified type

Note: chname and chtype are inverses of each other:
chname(geo1, chtype(geo1, tx)) = tx

}

{
chtype objectName channelName
Will return the type of the channel called 'name' of the object

Note: chname and chtype are inverses of each other:
chtype(geo1, chname(geo1, 1)) = 1

}

{
constant
This is a channel expression for a constant value.

}

{
cos number
This is a trigonometric mathematical function used to express
the cosine value of the number.

        i.e. cos (60)=0.5

}

{
cosh number
This is a mathematical function used to express the hyperbolic
cosine value of the number.

        i.e. cosh (2) = 3.7622

}

{
cubic
A channel interpolation function which uses the slopes at either
end to solve the differential equation to give a smooth curve between
the end points.

}

{
deg radians
Converts the radians value to a value measured in degrees.

}

{
ease
This is a channel expression function which will slowly ease in to
and out of any change. It will start at rest and slowly increase the
amount of change then, near the end of the function gradually reduce
the amount of change until it is at rest.

}

{
easein
This is a channel expression function which will slowly ease in to
any change.

}

{
easeinp
This is a channel expression function which will slowly increase
the motion of the model to its maximum value. This is similar to
the motion of an object accelerating due to gravity.

}

{
easeout
This is a channel expression function which will slowly ease out
of any change and come to rest.

}

{
easeoutp number
This is a channel expression function which is similar to the easeinp
expression only reversed. The change starts rapidly and begins to slow
until it comes to rest.  The number determines the inflection point of
the curve.  Increasing the number will shift the inflection point
to the right.  Fractional numbers will towards zero will shift the
inflection point to the right.  

}

{
easep number
This is a channel expression which will gradually ease in to the 
motion and gradually ease out. The ease out is faster than the 
ease in.

}

{
execute command
This expression will execute the given action command (enclosed in 
quotes)
eg. execute("list") is the same as typing list in the text port

}

{
exp number
This is a logarithmic exponentiation function.

	i.e. exp (2)= 7.3338906

}

{
expand line
This expression will expand all of the variables contained in a line.

	i.e. Action -> set name = geo1
	     Action -> echo `system("echo $name")`
                                   (the shell would evaluate $name)
	     Action -> echo `system(expand("echo $name"))`
	               geo1
	Here, the expand function expands the $name before it's passed
        to the system.

}

{
factorial number
Returns the factorial value of the number.

	i.e. factorial (5)= 120

}

{
fov target SOP camera
This  function is meant to be placed in the display channel of
an object. When the object is outside the field of view of the
specific camera a value of -1 is placed in the channel, turning
the object's display off. When the object is within the cammera's
field of view, a value of 1 is placed in the channel, making the
object visible.

}

{
mousecam Zvalue XY
This  function accepts a camera name and a Zvalue and then returns
an X or Y value which tracks the mouse X and Y movement relative
to the view relative to the camera of port1.  For TX, it returns 
the X value for the given Z value to move an object so that it
lies under the cursor.  It handles perspective and orthographic.

}

{
noise X Y Z
This function can be used to apply noise to geometry.
For example to make a bumpy grid you could append a point SOP and
use the following in the pos Z field:

noise($TX, $TY, $TZ) 

}

{
port portnum U V constant_type
This function takes a camera viewport number, (1, 2 or 3), a U
value (-.5 to .5 horizontal), a V value (range dependent on aspect
ratio) and returns a color value based on the provided constant_type.
The value of the type may be CR, CG, CB, CA, CHUE, CSAT, or CVAL.

}

{
ftoa number
This expression will convert a number to a string. Type conversion
is usually done automatically, however, you may wish to use this to
force the conversion.

}

{
atof source
Will forcibly convert a string into a float.

}

{
hsv red green blue constant_type
Converts the RGB value to one of the HSV values based on the
value of the type (HUE, SAT, or VAL)

}

{
if expression true_value false_value
If the expression is true, the function evaluates to the
true_value, otherwise the false_value is returned. The following
example shows that if the frame number is less than 12, the resulting
number equals the frame number. When the frame number reaches 12 or
greater, the resulting number is always 75.

	i.e. if ($F<12, $F, 75)

}

{
trunc number
The integer value of the number by truncating the number.  The number
is rounded toward 0.  That is, for positive numbers, the largest
integer less than the number will be returned.  For negative numbers,
the smallest integer greater than the number will be returned.

	i.e. trunc(2.6)=2
	i.e. trunc(-2.6)=-2

see also: int, floor

}

{
int number
The integer value of the number by rounding the fractional parts off.
If the fractional part is <= .5 then it rounds towards 0, otherwise it
rounds in the other direction.
	
	i.e. int(2.501)=3
	     int(-2.501)=-3

	     int(0.2)=0
	     int(-.2)=0

see also: trunc, floor

}

{
floor number
Returns the largest integer not greater than the number

	i.e. floor(10.2)=10
	     floor(-10.2)=-11

see also: trunc, int

}

{
isavariable variable_name
Checks only Action variables to see if variable_name exists.
Returns a 1 if the variable exists and a 0 if it does not. UNIX
variables are not checked.

}

{
iscamera
Is the object a camera? Returns a 1 if the object is and a 0 if 
it is not.

}

{
ischannel name channel_name
This returns a 1 if the channel name is a valid channel and the
channel has been created. Returns a 0 if not.

}

{
isdisplay object
Is the object on for display? Returns a 1 if the object is on for
display and a 0 if not.

}

{
isexposed object
Is the object exposed? Returns a 1 if the object is exposed and a 
0 if it is not.

}

{
isgeometry object
Is the object a geometry object? Returns a 1 if the object is a
geometry object and a 0 if it is not.

}

{
islight object
Is the object a light object? Returns a 1 if the object is a light 
object and a 0 if it is not.

}

{
ismaterial material_name
Is there a material name "material_name"? Returns 1 if the material
exists, and 0 if it does not.

}

{
isnumber text
This function will return 1 (true) if the given string represents a
number and 0 (false) if it does not.

	i.e. isnumber("10") = isnumber("0") = 1
	     isnumber("abc") = isnumber("10abc") = 0

}

{
isobject object_name
Is there an object "object name"? Returns 1 if the object exists,
and 0 if it does not.

}

{
isscoped
Is the object scoped? Returns a 1 if it is and a 0 if it is not.

}

{
issop object_name sopID
Tests whether a SOP exists.  The sopID may be an identifier like
"display" or "last", or it may be the SOP label, or the number
of the SOP (SOP numbers start at 1).  This function will return
the SOP number of the SOP if it exists, or 0 if it does not.

	i.e.  Action -> `echo issop(geo1, "display")`
	      1
	      Action -> `echo issop(geo1, "847")`
	      0

}

{
istimemark timemark_name
Is there a timemark "timemark name"? Returns 1 if the timemark exists,
and 0 if it doesn't.

}

{
isvariable variable_name
Is there an Action variable "variable name"? Returns 1 if the variable
is defined, and 0 if it doesn't. Action variables are checked as well
as well as unix variables (see isavariable).

}

{
length x y z
Returns sqrt(x*x + y*y + z*z), the length of the vector

}

{
limb name sop_num constant_type
This function will extact inverse kinematic rotations from a limb sop.
This is useful for creating hierarchical systems that mimic the limb.
The object name is the name of the object containing a limb sop.
The sop_num is the number of the limb sop.
The type is a constant: HIP_RX0, HIP_RX, HIP_RY, HIP_RZ, KNEE_RX,
 ANKLE_RX, ANKLE_RY, ANKLE_RZ
 FOOT_TX, FOOT_TY, FOOT_TZ, FOOT_RX, FOOT_RY, FOOT_RZ

}

{
linear
This is a channel interpolation function which will do linear
interpolation of the end points.

}

{
log number
This is the natural logarithm of the number.

	i.e. log (2.718281828)= 1

}

{
log10 number
This is the logarithm base 10 of the number.

	i.e. log10 (10) = 1
	     log10(100) = 2

}

{
lookat eye target type
Will compute the rotatation for the eye object to look at the target
object by returning the angles. The type is usually either RX, or RY.
This function does not set the Z rotation. It also assumes that the 
transform order of the first object is the transform order.

}

{
match
This is a channel expression which will match the in coming and
out going slope.  The curve will move smoothly from the in coming
value to the out going value.

}

{
matchin
This is a channel expression which will match the in coming slope and
extend the previous segment in a straight line from where it completes.

}

{
matchout
This is a channel expression which will compute a straight line which
has the same slope as the in coming slope of the next segment.  It will
compute this straight line so that the value will have a smooth
transition into the next segment.

}

{
max value1 value2
Returns the larger of value1 or value2.

}

{
min value1 value2
Returns the smaller of value1 or value2.

}

{
maximum value1 value2
Returns the larger of value1 or value2.

}

{
minimum value1 value2
Returns the larger of value1 or value2.

}

{
objmaterial
Returns the name of the lava material used by this object.  If there is
no material used, an empty string ("") will be returned.

}

{
oldrand value
Gives a pseudo-random number between 0 and 1 depending on the value.
If the same value  is used the same number will result each time. A
different number is returned if fractional values are different.

	i.e. oldrand(12.1) gives a different result than oldrand(12.2)

NOTE:  It is a good idea to use non-integer values as the argument
       to oldrand().
       This function is similar to rand() but uses a different
       algorithm for generating the random numbers

see also: rand

}

{
oname object_number
Returns the name of the object specified by the object_number.

	i.e. oname (4)= geo1

}

{
onum
This function takes any object name and returns the object number.
This is used in channels like parent which contain the object 
number of the parent.

	i.e.	onum(geo1) = 4

}

{
orient source target sop polynum type
Will compute the transform necessary to position the source
object at the polygon specified in the target object SOP
Where type is one of TX, TY, TZ, RZ, RY or RZ

}

{
origin obj1 obj2 constant_type
This function will return one of TX, TY, TZ, RX, RY, RZ value necessary
to translate object1 to object2, depending on the constant type
(TX, TY or TZ).

This can also be thought of as the position of object2 relative to
object1.tWill compute the position of obj1 relative to obj2 and returns
one of TX, TY, TZ, RX, RY, RZ based on the type argument

}

{
ostring string_name
Returns the object string of the object specified by the
string name. The string name can be any one of the names used by the
ostring command (see the help for the ostring command for a
complete list).

	i.e. ostring (geo1, detail)
	     polygon -s

}

{
padzero number value
Returns a string containing value preceeded by enough zeros to make up
'number' digits

	i.e. padzero(5, 126) = 00126
	     padzerp(5, 23) = 00023
	     padzero(1, 23) = 23

}

{
mat matName tx ty tz mapu mapv attrib constant_type
This function allows the evaluation of any material's attributes.
The matName is the name of a lava material (loaded into Action).
The tx, ty, tz parameters are the position to evaluate the material
at (this is only imporant if there are positional texture operators
used).  The mapu & mapv are used to determine the initial texture
coordinates for evaluation.  The attrib can be one of the following:
    amb   - Ambient color	rough	- Roughness value
    diff  - Diffuse color	refract - Index of Refraction value
    spec  - Specular color	fresnel	- Fresnel value
    refl  - Reflection color	apara	- Alpha para value
    trans - Transmit color	aperp	- Alpha perp value
    emit  - Emit color		aroll	- Alpha rolloff value
				shadow	- Shadow value
				bias	- Bias value
When evaluating a color, the "constant_type" parameter is used
to determine what aspect of the color is returned.  The value for
the constant_type can be one of:  CR, CG, CB, CHUE, CVAL, CSAT.
When evaluating a value, the constant_type is ignored.

	i.e. mat(gold, 0, 0, 0, 0, 0, diff, CR)

see also: matbase

}

{
matbase matName attrib constant_type
This function allows the evaluation of any material's attributes before
any texture operators are applied.  The attrib can be one of the
following:
    amb   - Ambient color	rough	- Roughness value
    diff  - Diffuse color	refract - Index of Refraction value
    spec  - Specular color	fresnel	- Fresnel value
    refl  - Reflection color	apara	- Alpha para value
    trans - Transmit color	aperp	- Alpha perp value
    emit  - Emit color		aroll	- Alpha rolloff value
				shadow	- Shadow value
				bias	- Bias value
When evaluating a color, the "constant_type" parameter is used
to determine what aspect of the color is returned.  The value for
the constant_type can be one of:  CR, CG, CB, CHUE, CVAL, CSAT.
When evaluating a value, the constant_type is ignored.

	i.e. matbase(glod, diff, CR)

see also: mat
}

{
pic pic_number U V constant_type
This function uses images loaded into Action via Load Map Images in the
Display Opts menu. It gets color information from a map. Pic_number is
the picture number. U and V are the desired U and V coordinates of the
pixel you wish to use. In the following example you use this function
in a point SOP. In order for this to work, texture U and V coordinates
must first be applied to the points using a texture SOP. The constant
type is any of the color constants accepted by Action, such as CR, CG,
CB, CHUE, CSAT and CVAL.

	i.e. pic(1, $MAPU, $MAPV, CR)

}

{
tex textureName U V constant_type
Similar to the pic() function, however, the first argument is the
texture map name. 

	i.e.  Action-> echo `tex("Mandril.pic", .5, .5, CR)`
                       0.2359

The lookup function does bi-linear interpolation on the pixels it.

This function is the same as the texmap() function.

}

{
texmap textureName U V constant_type
Similar to the pic() function, however, the first argument is the
texture map name. 

	i.e.  Action-> echo `texmap("Mandril.pic", .5, .5, CR)`
                       0.2359

The lookup function does bi-linear interpolation on the pixels it.

This function is the same as the tex() function.

}

{
texni
Like the tex() function, however, the map lookup is non-interpolated
(not so smooth).

}

{
texz textureName X Y
Returns the Z value of a bump map

}

{
timecode hour min sec frame
Returns the action frame number for the given timecode information

}

{
wave value frequency amplitude offset
This function can be used to apply waves to geometry.
For example to make a grid with radial ripples you could append a
point SOP and use the following in the pos Z field:

wave (sqrt($TX*$TX+$TY*$TY), 120, .3, -$F*2)

Increasing the frequency increases the number of ripples, increasing
the amplitude increases the height of the individual ripples and
changing the multiple in the offset (-$F*2) will increase the speed of
the rippling.

}

{
npoints name SOP
This function returns the number of points in the SOP.  -1 is returned
if the SOP cannot be cooked.

}

{
npolys name SOP
This function returns the number of polygons in the SOP.  -1 is returned
if the SOP cannot be cooked.

}

{
bbox name SOP type
This function will return bounding box information for a SOP.  The
type can be one of XMIN, YMIN, ZMIN, XMAX, YMAX, or ZMAX for the
corresponding values of the bounding box.

}

{
point name SOP point_number constant_type
This function will extact information from a point in an object. The 
object name is expressed as its number, object sop number is the SOP 
number and point number is the point number the object will use. The
type is any Action constant (i.e. TX, TY, TZ, NX, NY, NZ, CR, CG
CB, CA, MAPU, MAPV, CHUE, CSAT, or CVAL

Note: This function will interpolate between point values if the point
number is fractional, such as 3.35

}

{
poly name SOP poly type
Will return an attribute of the polygon specified in the object's SOP.
The type may be one of NX, NY, NZ, CR, CG CB, CA, CHUE, CSAT, CVAL,
or NPTS.  NPTS will return the number of vertices in the polygon
specified.

}

{
positive number
Returns 1 if number > 0 and returns 0 if number <= 0
    
	i.e. positive(1) = 1
	     positive(0) = 0
	     positive(-1) = 0

}

{
pow base exponent
This computes the base to the power given.

	i.e.  pow(2, 3) = 8

}

{
pulse value start end
This function creates an on/off pulse. If the value is less than start
or greater than end, pulse returns a 0. Otherwise, it returns 1. 
Frequently, start and end are frame numbers and val is the current
frame, $F.

}

{
quintic
A channel interpolation function which uses the slopes and
accelerations to smoothly interpolate the segment.
}

{
rad number
Converts the number to radians assuming that the number is measured in
degrees.

	i.e. rad (180)=3.1415926

}

{
ramp ramp_number ramp_index constant_type
This function applies a color ramp to geometry (Color ramps are created
using the PRISMS program redit). Most commonly, this is used in a Point
SOP.

For example, in the Point SOP, select Output Point Colors. In the red 
field, type ramp(1,$BBX,CR). In the green field, type ramp(1,$BBX,CG)
and in the blue field, type ramp(1,$BBX,CB). This assigns color ramp 1
across the X direction of the geometry in the Point SOP's source. (The
color ramp must first be loaded into Action using Load ramp files from
the Display Opts menu). You could alter this and assign the ramp in the
Y direction instead by substituting $BBY for $BBX, and so on.

See additional notes in the manual about other possibilities.

}

{
rand value
Gives a pseudo-random number between 0 and 1 depending on the value.
If the same value  is used the same number will result each time. A
different number is returned if fractional values are different.

	i.e. rand(12.1) gives a different result than rand(12.2)

NOTE:  It is a good idea to use non-integer values as the argument
to rand().

see also: oldrand

}

{
reach hip thigh shin foot print flip
This function is used for inverse kinematics to assist in the animation
of arms and legs for characters. There are two Object Macros availible
in the OBJECTS dialog list to assist in setting up this function: Tube
Limb with inverse kinematics and Box with inverse kinematics. Reach
handles legs very well, but has some difficulty with arms, especially
when the handprint is raised above shoulder level.

This is an unusual function in that it puts values into other channels
besides the one in which it resides.

See Section 2.2.7-Object Macros on page 39 of the manual.

}

{
repeat t1 t2
A channel interpolation function which repeats the motion between
times t1 and t2.

}

{
rgb hue saturation value constant_type
This function, when given values for hue,saturation and value
(brightness), returns the red, green or blue equivalent component,
depending on the constant type (CR, CG or CB)

}

{
sign value
The sign of the value. For example, it returns 1 if the value is any
positive number, -1 if the value is a negative number and 0 if the
value is 0.

}

{
sin
This is a trigonometric mathematical function used to express
the sine value of the number.

        i.e. sin (60)=0.866025

}

{
sinh number
The hyperbolic sine of the number.

}

{
smooth value minimum maximum
The return value is a smooth interpolation between 0 and 1. When the 
value is less than the minimum, the return value is 0. If the value
is greater than the maximum, the return value is 1.

	i.e. smooth ($F, 12, 55)
	This will generate an ease-type curve between values 0 and 1,
	starting at frame 12 and ending at frame 55. Dig it!

}

{
spline t1 t2 tension
A channel interpolation function which runs a spline through the
timemarks specified by t1 and t2 (including all the timemarks between
t1 and t2).  The tension specifies the tension of the spline.

}

{
sqrt number
The Square root of the number.

	i.e. sqrt (144)=12

}

{
strcat
This will concatenate two strings.

        i.e. strcat("Current motion file is; ", $MOTNAME)
             Current motion file is job1.bmot

}

{
strcmp
Returns a negative number if s1 is lexagraphically less than s2
Returns a positive number if s1 is lexagraphically greater than s2
Returns a zero if s1 is equal to s2
	i.e. strcmp("abc", "xyz")=-23
	strcmp("xyz, "abc")=23
	strcmp("abc", "abc")=0

}

{
strlen
Returns the number of characters in the string.
	i.e. strlen("abcde")=5

}

{
substr
This will extract a sub-string of the first argument.
	i.e.  Action-> echo `substr("abcdefghijklm", 3, 4)`
              defg
        Note:  The first character is specified by a start of 0

}

{
system
Returns the output of a unix command.
	i.e. system("finger")`
	mark     Mark Elendt           q1    45 Fri 14:46

}

{
systemES
Returns the exit status of a unix command.
	i.e. Action-> echo `systemES("test -r $HOME/.prisms/action.rc")`
        0

}

{
tan
This is a trigonometric mathematical function used to express
the tangent value of the number.

        i.e. tan (60)=1.73205

}

{
tanh number
The hyperbolic tangent of the number.

}

{
wrap
Similar to the clamp expression in that the resulting value will always
fall between the specified minimum and maximum value. It will, however,
create a sawtooth wave for continuously increasing or decreasing values
of the value.

	i.e. wrap ($F, 5, 10)
	This will create a sawtooth function between 5 and 10.

}

{
index source pattern
Finds the first occurance of pattern in source and returns the number
of characters before the pattern occurs.  If the pattern is not found
-1 is returned.

	i.e.  Action -> echo `index("Testing index", "sting")`
	      2
	      Action -> echo `index("Testing index", "i")`
	      4

See also: rindex

}

{
rindex source pattern
Finds the last occurance of pattern in source and returns the number
of characters before the pattern occurs.  If the pattern is not found
-1 is returned.

	i.e.  Action -> echo `rindex("Testing rindex", "sting")`
	      2
	      Action -> echo `rindex("Testing rindex", "i")`
	      8

See also: index

}

{
nsops SOPobject
Returns the number of SOPs in the object specified.

	i.e.  Action -> echo `nsops(geo1)`
	      1

}

{
param index
There are 10 global parameters, set by the stamp SOP or the paramset()
function, this gets the value.  These global parameters exist because 
Action varibles take too long to search and Action SOPs don't always
detect when variables change.

}

{
paramset index value
There are 10 global parameters, this sets index's parameter to value.

}

{
midiseq sequence index
There are up to 200 pre-defined MIDI note sequences.  index fetches
a sequence's note number.

}

{
execute command
Executes command as an Action keyboard command.  Returns 0.

}

{
print float
Prints the value of the expression into the textport and returns
the same expression value.  This can be used to diagnose
parameters in SOPs or channels.

}

{
tmunique pattern
returns a unique timemark name based on the supplied pattern.

}

{
tmprefix
Returns the prefix that is currently used to create new timemarks in the
graph dialog. This function was supplied primarily for use with the -p
option of segset.

}
