Jump to content

To Backtick Or Not For Opinput, Oppwf, Opname


Recommended Posts

Hello,

So I'm working on some otls and am having some problems with paths.....

As a test I have the following network structure:

SphereSOP->TransforrmSOP1->TransformSOP2

For TransformSOP1 I have the tx parameter set to 2.

On the TransformSOP2 I have tried the following to extract TransformSOP1's tx value:

ch(`opinput(".", 0)`"/tx")
ch(opinput(".", 0)"/tx")
ch(`opinput(".", 0)`+ "/tx")
ch(opinput(".", 0)"+ /tx")

In the long run, I'm just trying to avoid hardcoding the full path to SOPs in my expressions because I naturally get errors when I try to make an otl. I did also try oppwf() but still at a loss when to backtick, when not to backtick, how to concatenate, etc.

Any tips is much welcome!

Cheers,

Rick

Link to comment
Share on other sites

In Houdini, there are two distinct languages (I *think* mostly due to legacy reasons from PRISMS). It's sort of like:

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. From (2), we can use the run() expression function to access (1).

In your specific example, you were in (2) trying to access (2) and so no backticks were required.

I guess 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. :)

Link to comment
Share on other sites

so backticks are not needed I see. So when would i use a backick? textport only?

20639[/snapback]

Backticks are only needed for string fields. In numerical fields putting a backtick will return 0 always (which the return value of the evaluation - useless).

I get this wrong almost every day :) but I remember almost every day too.

Link to comment
Share on other sites

Ah yes, I forgot about string parameters. I guess more generally, backticks are used to get into the (2) world when you're outside.

20643[/snapback]

Yup good info guys. I get it now. It now makes sense why my otls weren't working as I expected.

Cheers,

Rick

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...