Preview String/Path Expression Values

   3352   3   2
User Avatar
Member
39 posts
Joined: Oct. 2017
Offline
I was taught Houdini this way and never got around to questioning this initially, but it's been bugging me for a good while now:

Why can't we preview string/path expression output in the parameter panel, the same way that we can preview numerical expressions?



Suppose I create two parameters - one float, one string. The expression for the float parameter is 3+7 and for the string parameter it's `3+7` with backticks. I can click on the float parameter name to switch between expression view and evaluation view, the latter of which tells me that the expression evaluates to 10.

But you can't do this for strings.

I can stick down a point wrangle node further down the line, read the string parameter into a point string attribute and in the Geometry Spreadsheet I can see that yes, that evaluates to “10”, and I can evaluate it in a Python script and write myself a debug output that tells me what the answer is.

But is there a good reason why, fundamentally, string parameters don't behave like numerical parameters?

You often end up with pretty complicated string parms - using $ attributes like $HIP, using backtick expressions, reading other channel values and so forth, and it can be very awkward to debug that your expression is giving you the correct format for the string or the path that you want. Being able to click and preview these expressions would be immensely useful.

It looks like such an obvious omission, that I assume there must be some very good reasons for this, but I can't think of what might be broken or display incorrectly if a preview were added - there's a Python expandStringAtFrame() function, which does pretty much this. Why not hook it up as default functionality?
Edited by 9of9 - Aug. 12, 2019 11:37:12
User Avatar
Member
67 posts
Joined: April 2018
Offline
9of9
Why can't we preview string/path expression output in the parameter panel, the same way that we can preview numerical expressions?
We can, actually. MMB click on the parameter label. It will look like this, with the field surrounded by a dotted line.

Attachments:
hindie_2019-08-12_17-28-07.png (15.1 KB)

User Avatar
Member
39 posts
Joined: Oct. 2017
Offline
Mind blown!

I've been using Houdini for years without knowing about this.

Looking into the expression right-click menus, I can see now where I could have found this, too. It seems like ‘Toggle Expression’ and ‘Expand String Value’ are two separate functions, mapped to different keys.

Is there a good reason for them being kept as separate functions in that case? I can imagine there being a situation where you might have a numerical expression that contains strings (e.g. paths to other nodes) that themselves contain expressions, and in that case maybe ‘Expand String Value’ would expand the strings in that expression, rather than outright toggling the expression view.

However, that doesn't seem like something you can actually do - and even then, in the case of a string parameter, it would be a little bit more intuitive if you could still left-click it to view the string expansion.
Edited by 9of9 - Aug. 12, 2019 11:59:24
User Avatar
Member
67 posts
Joined: April 2018
Offline
9of9
Is there a good reason for them being kept as separate functions in that case?
I would like to know for certain as well. My guess is that it's to let the user validate an expression in a string parameter without having to create an animation channel for it.
  • Quick Links