expressions no work anymore!

   6705   8   2
User Avatar
Member
4 posts
Joined: 7月 2005
オフライン
i've been trying using expressions under the file filter to import my sequence of .bgeo files.

i've had success for my past few projects, but for some reason,

this time, it can't read the expression anymore!

i go and check my old files, and the bgeo sequences can't be detected

and all i see is a red play button in the network.

the expression is : Pfolder/run'$F%20+4'.bgeo

(for files run4.bgeo, run5.bgeo… run23.bgeo)

and it worked fine until recently.

help me!
User Avatar
Member
8164 posts
Joined: 7月 2005
オフライン
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 (').
User Avatar
Member
4 posts
Joined: 7月 2005
オフライン
i've been using quotes not back quotes.

the files are still there.
i can actually type in the .bgeo individually into the expression:

run4.bgeo.

and it works.

even run$F.bgeo works.

it's just that when i type run'$F%20+4'.bgeo

it doesn't work. am i doing something wrong here?
User Avatar
Member
8164 posts
Joined: 7月 2005
オフライン
Try using backquotes instead of quotes.
User Avatar
Member
4 posts
Joined: 7月 2005
オフライン
man.. it did the trick…

talk about being SPECIFIC.


thanks man! wicked!

now i can finish my work! lol

cheers
User Avatar
Member
2199 posts
Joined: 7月 2005
オフライン
talk about being SPECIFIC.

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
User Avatar
Member
13287 posts
Joined: 7月 2005
オフライン
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
User Avatar
Member
276 posts
Joined: 7月 2005
オフライン
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.

Hope that helps,
George.
User Avatar
スタッフ
2540 posts
Joined: 7月 2005
オフライン
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.
There's at least one school like the old school!
  • Quick Links