If your old expressions which used to work no longer work then maybe the files are no longer there? Note that I assume that you meant type the expression using backquote (`) instead of quotes (').
That's the problem with computers, they're all really dumb
Once you get in the habit of using backticks you should be fine, it's a bit mixed in Houdini because of backwards compatibilty some fields don't need them others do. But it will never be anything else but backticks or nothing.
The trick is finding just the right hammer for every screw
jamuck man.. it did the trick… talk about being SPECIFIC.
You may notice that hscript and the expression language is modeled pretty closely on a cshell and a unix file structure. In cshell (and many other scripting languages) the backticks are used to cause evaluation of whats inside.
Jason Iversen, Technology Supervisor & R&D Lead @ WetaFX
Just like Jason said, the whole thing is a lot easier if you understand csh scripting.
One way that may help in determining whether or not you need backticks is to ask the question: “is the expression result ambiguous?”
For example, if in a string field I type sin(3.1415)
It is ambiguous, because I could either mean: the string literal “sin(3.1415)”; or the result of the expression which is the real number (close to) 0. In the string field, Houdini assumes the literal, unless there are backticks which indicate that the result of the expression is desired.
Now if I type the same thing in a number field (like tx for example), Houdini won't want the string literal “sin(3.1415)” because that's not a number, so instead it will treat it as an expression by default and no backticks are required (or allowed).
That may be an oversimplified view of it, but I hope it helps disambiguate the uses of backticks. One last thing to keep in mind, is that in most places, I believe, variables (e.g. $F) are expanded first.
You need backticks to evaluate an expression when all the parameter expects to see is text or in shell language, a “string”.
This is pretty simple in Houdini. If you can't set a keyframe on a parameter value, chances are you have a string parameter. Now you need to use backticks to evaluate any expressions.
I like to show new users the Font SOP. The text field is just that, a string text field. If you can get your expression to evaluate in this string field using the special backticks ``, it is pretty obvious. Next copy and paste expression in to your intended string parameter.
George's example of sin(3.1415) in any keyable parameter would evaluate nicely as is. Put this in the font SOP text field and you literally get sin(3.1415). Then enclose in backticks `sin(3.1415)` and it “forces” the expression to evaluate when the parameter expects text or a “string”.
You can jamb several expanding expressions with text like this: The current frame is: `$F` and sin(3.1415) equalls `sin(3.1415)` The font SOP will evaluate $F and the second sin() function nicely for you.
The only thing you can't do and gets even the best of us is nesting of back ticks. Like this: `sin($F + `ch(“../tx”)`)` No good.
You can also make expressions evaluate in the textport like the with the Font SOP but you need to use the houdini textport command echo. So the above would look like: / -> echo The current frame is: `$F` and sin(3.1415) equalls `sin(3.1415)` The / -> is the houdini textport prompt so don't type that in.
I hope this helps. It's not rocket science nor do you need to know shell programming. Just the basics of Houdini scripting.