I still don't understand local variables. Are they @ or $?

   3909   2   1
User Avatar
Member
716 posts
Joined: Aug. 2019
Offline
For example I've seen a PolyWire set like this:




How does this work? Is @width an attribute or local variable? Or a local variable that links to an attribute?

How could I know which local variables a node supports? PolyWire [www.sidefx.com]'s document says:

The four numerical parameters support all the local variables of the Point operation, plus the LSYSTEM specific variables of $WIDTH, $SEGS, $DIV, $LAGE, $GEN, and $ARC.

It says $WIDTH, not @width. Are they the same thing? If not, how do people know to use @width? By trial and error?
Edited by raincole - April 15, 2022 18:16:19

Attachments:
houdini-indie-euskara-2018-08-06.png (11.6 KB)

User Avatar
Member
8303 posts
Joined: Sept. 2011
Offline
Forget it jake
User Avatar
Member
1868 posts
Joined: May 2006
Offline
Yep, it's a mess.

In the beginning $ was used in hscript to refer to variables, all very parameter focused. There'd be a few global ones like $F, $T, $RFSTART, amd others that'd only be available on specific sops, eg $WIDTH on polywire, or $CEX/$CEY/$CEZ on transform sops.

@ was used in vex wrangles to refer to geometry attributes, and a few global pseudo attributes that vex supports like @Frame, @Time.

At some point it was decided that group expressions could refer directly to geometry attribs with the @ prefix, and a handful of the global vex attribs would also be available to hscript like @Frame.

Further, because the text editor for vex wrangles is ultimately a parameter field, and parameters can expand variables, it kind of looks like vex can support $ vars too, but it can't. The text field first runs through and replaces $PI or $F with the baked values, and these are then passed down to the vex compiler.

As a result, its hard to know where the demarcation line sits until you've used Houdini for a while. It's messy and inconsistent, but thats the price of having a piece of software thats 25 years old, and generally has a policy of 'don't break old setups'.
http://www.tokeru.com/cgwiki [www.tokeru.com]
https://www.patreon.com/mattestela [www.patreon.com]
  • Quick Links