F u n c t i o n s

View messiah's functions by: Name or Category

messiah's expression and scripting engine allow you to use pre-defined functions in your expressions. Functions allow you to perform multiple and complex actions without much effort on your part. For example the function IK2D will perform many complex operations to come up with an IK solution and assign the results of that solution to the items defined by the function. All you have to provide is some simple information to the function so that it can do it's thing. When it's done the function will return a value which might be the result of the function or some flag indicating success or failure depending on the function, in this case it will return 1.0 for success and 0.0 for failure.

When a function appears in an expression such as: 2 + foo(25), the value returned by the foo function is added to 2. It is important to note that the function must execute before the return value can be passed back to the expression so something like: cond( Align( Null, Null_1, 1) , 1, -1), will cause Null to be aligned to Null_1 (executing the Align function) then the return value will be passed to the cond function. So when a function appears in an expression think of it as it's return value.

As far as an expression is concerned a function is the value it evaluates to (it's return value) so we must be careful how we treat multiple functions with different return types in a single expression. For example consider the following: Align(Null, Null_1, 1) + SetVecD3(1.0, 1.0, 1.0). If we tried to use that expression the variable would report the following error: Argument 'SetVecD4' is incompatible with previous argument. The reason for the error is that as far as the expression is concerned we are trying to add a double to a vecD4, the two types are not the same. So if we were to have both of these functions in the same expression we would need to separate them with a semi-colon like so: Align(Null, Null_1, 1) ; SetVecD3(1.0, 1.0, 1.0). We will still get a warning saying that the return value of the expression is undefined, that's fine as long as we don't reference the variable this expression is assigned to somewhere else.

The format of the function definitions is as follows:


Compatible With ScriptsCompatible With ExpressionsCompatible With The Command Line

returnType FunctionName (argType arg, argType arg2, …, argType argN )

Return Value: description of the value returned by the function.



description of arg and meaning of possible values


description of arg and meaning of possible values


description of arg and meaning of possible values


Description of the function.


|_FunctionName( )

Description of the example.

Converted from CHM to HTML with chm2web Pro 2.82 (unicode)