Jump to content

Backticks.


mawi

Recommended Posts

Hi,

in Houdini, similar to Maya as I thought, you can think about two or even three languages:

1. Languages:

- Hscript (look for help in Texport via "help")

- Expressions (look for help in Texport via "exhelp")

- Python

-(gosh, lets add the forth: VEX)

2. Differences in use:

- Hscript executes commands (add operator, delete, rename, link)

- expressions computes a value (compute angle, matrix etx)

- (Python does both)

- (VEX modifies variable's value like point position, surface colour, pixel value etc)

3. Backticks usage:

- backticks allows you to place expressions in hscript...

- or execute expression in a parameter that does NOT expect numeric value (like string parameter)

for example, in file input path, you could write:

op:/`opinputpath(".",0)`

or:

./my_great_texture.`padzero($F-10)`.rat

since this input file field expect string and it couldn't recognize padzero() as an expression in other way.

But in case of translation parameter you need just an expression:

fit01(rand($PT), 0.5, 1))

without backticks, since a parameter expects numeric value anyway.

So:

- using expressions inside hscript requires ``

- you also need `` to evaluate an expression in non-numeric neighborhood, like strings, paths etc.

- but you don't need it if expression is evaluated in numeric parameter.

- you can also in opposite use hscript in expression with "run()" or "execute()" functions.

- both expressions and hscript are accessible in Python with hou.hscript() or hou.hscriptExpression() (Unless they have pure equivalents in Python like opadd == hou.createNode() ).

hope this helps,

Simon.

PS There are also expressions returning strings like points(), chs() and they need backticks also to be executed in parameters but not taken "as is".

Edited by SYmek
  • Like 3
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...