Expressions

From Odwiki

Jump to: navigation, search

Houdini supports expressions in all fields and in HScript (the program). To find out which expressions you may use, open a Textport and type exhelp and you'll get a list of available expressions. To get help on hscript "commands", type "help" to get the list of available commands.

In Houdini, there are two distinct languages (not counting Python in H9):

  1. "hscript, the command language": the stuff found in the help command and what you type in the textport
  2. "hscript, the expression language": the stuff found in exhelp and what you type in animatible parameters

So from (1), we use backticks to access (2). That's why in the textport, you need backticks for all stuff associated with exhelp. For example, one needs to use backticks when in the textport:

 echo `sin($PI)`

From (2), we can use the run() expression function to access (1). For example, one needs to use run() when inside a parameter:

 arg(run("fps"), 7)

A rule of thumb then is that you use backticks when passing the result of something found in exhelp to a command found in help.

In string fields, use backticks around your expression to evaluate it. In numeric fields you don't need them (and can't use them).

You may extend the expression set with CustomExpressions and the HDK.

© 2009 od[force].net | advertise