Python not allowed in some nodes?

   3395   5   2
User Avatar
Member
277 posts
Joined: 7月 2006
Offline
Hi, I'm learning python in houdini now and I saw recently that when I use some nodes and want to script their channelsI can only use HScript…
Is that true? F.E. (see image below) I made curve (2points), then resample and then i added point node - I want to be sinusoidal.
My default scripting language is pytho - when i write sin(($TX+$F/1000)*600)/5 - eveything works (but it's Hscript - isn't it?)
and when i want to use something like hou.frame() it doesn't work.

WHEN I'M USING OTHER NODES THE EXPRESSIONS FROM PYTHON (f.e. hou.frame() ) are working.

Additional the “windows” are red and when I switch to Hscript the're green.

I really please about help

User Avatar
Member
7025 posts
Joined: 7月 2005
Offline
RMB on the parameter or go to the Gear menu and select Python as the scripting language… default is Hscript.

Cheers,

Peter B
User Avatar
Member
1390 posts
Joined: 7月 2005
Offline
danilo2
Hi, I'm learning python in houdini now and I saw recently that when I use some nodes and want to script their channelsI can only use HScript…
Is that true? F.E. (see image below) I made curve (2points), then resample and then i added point node - I want to be sinusoidal.
My default scripting language is pytho - when i write sin(($TX+$F/1000)*600)/5 - eveything works (but it's Hscript - isn't it?)
and when i want to use something like hou.frame() it doesn't work.

WHEN I'M USING OTHER NODES THE EXPRESSIONS FROM PYTHON (f.e. hou.frame() ) are working.

Additional the “windows” are red and when I switch to Hscript the're green.

I really please about help

He there!
After changing default expression language for a node, delete any existing expression in parameters. $TX for example is not a valid python expression, so putting hou.frame() at the front of it doesn't make sense.

- change expression language
- delete existing channeles ( Ctrl+Shift+LMB)
- do your stuff (with hou.lvar(“TX”) call to access local variables)

hope this helps,
skk.

PS red background means that the expression in a parameter is of another type then a one specified as default for a node. If default is python, red bk have hscript expressions and vice versa.
User Avatar
Member
277 posts
Joined: 7月 2006
Offline
Thank you so much Symek!
Always when I need help you're the best “houdini encyclopedia”

Ou and now I have to ask about something else:
is calling “hou.lvar(”TX“)” the only method to access variable tx?
or can I use something like parm(“tx”)?

thank you
User Avatar
Member
1907 posts
Joined: 11月 2006
Offline
To get access to the currently iterating point's position in the X axis you can do the following:
hou.pwd().curPoint().position()
Graham Thompson, Technical Artist @ Rockstar Games
User Avatar
Member
277 posts
Joined: 7月 2006
Offline
thank you Is there any list of commands like this one?
When I'm for example using Hscript and I click on question mark I'm getting list of all Hscript local variables, but with python I have to use other structures or as Symek has wrote, I have to use something like hou.lvar(“…”).
Is there any table with only “python ways” to access these vars?
  • Quick Links