@Time in promoted variables in Attribute VOP

   2015   5   0
User Avatar
Member
6 posts
Joined: Oct. 2018
Offline
so i feel like i've done this before but in Houdini 18.5.351
anytime i use @Time in a promoted variable i get an invalid syntax error
the promoted offset is in the Turbulent Noise node
added a hip file. really simple stuff. maybe i am doing it wrong?
Image Not Found
Edited by RJM - Nov. 29, 2020 15:16:37

Attachments:
errorVOP.PNG (117.0 KB)
attVOPerror.hiplc (102.3 KB)

User Avatar
Member
7794 posts
Joined: Sept. 2011
Online
Your node's language is set to Python. Click the python icon on the node to change it to Hscript and then go into preferences and make sure the default for new nodes is also set to Hscript to prevent this issue in the future.
User Avatar
Member
6 posts
Joined: Oct. 2018
Offline
you're right @jsmack.
is there a python equivalent?
i thought VEX was its own language.

*edit*
still a little confused.
using @Time with hscript set as the language works and when switching to python the parameter turns purple and still works.
so i don't get why it wouldn't work when using @Time in python and just turn the parameter purple.
Edited by RJM - Nov. 29, 2020 20:41:05
User Avatar
Member
7794 posts
Joined: Sept. 2011
Online
RJM
is there a python equivalent?
yes

RJM
i thought VEX was its own language.
Yes, but it's not used here since were talking about a parameter expression.

RJM
*edit*
still a little confused.
using @Time with hscript set as the language works and when switching to python the parameter turns purple and still works.
so i don't get why it wouldn't work when using @Time in python and just turn the parameter purple.

Changing the language of the node affects future channels, not existing channels. The parameter turns purple when changing the node language to indicate that the parameter's language is different from the node's.
User Avatar
Member
6 posts
Joined: Oct. 2018
Offline
thanks for responding. i'm guessing hou.time() is the correct way for a python node.
i guess i misunderstood VEX snippets and global variables.
these variables must be a VEX wrapper for HScript expressions.

Unlike in HScript expressions, you cannot use global variables such as $F.

In a VOP, you can wire variables such as Time and Frame from the Globals node to use them in a VEX snippet.

You can use the following implicit variables:

@Time

Float time ($T)

@Frame

Float frame ($FF)

@SimTime

Float simulation time ($ST), only present in DOP contexts.

@SimFrame

Float simulation frame ($SF), only present in DOP contexts.

@TimeInc

Float time step (1/$FPS)
User Avatar
Member
7794 posts
Joined: Sept. 2011
Online
RJM
these variables must be a VEX wrapper for HScript expressions.

These are convenience variables for use in wrangles/attrib vops, but again they're irrelevant since the issue was with a parameter expression which is either python or hscript. VEX is for what's inside the attribute VOP, or the snippet text of a wrangle. A parameter going into an attribute vop has its value determined outside of the VEX context.

With an attribute VOP, these globals are available by naming the parameter with the corresponding name, e.g. “Time”, “Frame”, “TimeInc” and binding the appropriate type. Some of these are already done for you on the geometry vop globals node. The value is ignored and should be left blank/default.
  • Quick Links