local variables - is there equivalent in python?

   2542   2   1
User Avatar
Member
130 posts
Joined: April 2009
Offline
Hi Evbody,

The new Houdini allows choosing whether you want to use hscript or python. Does it apply to all places inside it, to all params, etc?

For example, what is a python equivalent of $TX, $TY, $TZ, etc?
And, is there a place, where such equivalents would be documented? I've searched the forum, I've searched the docs - all in vain.

I'll be grateful for help with this.

Cheers,
Greg
User Avatar
Member
665 posts
Joined: July 2005
Offline
Have a look in here.

It's a great intro to some of the basic Python functions.

http://localhost:48626/hom/cookbook/color_falloff/ [localhost]

cheers,
-j
User Avatar
Member
130 posts
Joined: April 2009
Offline
Thank you!

Your link directed me to the following:

In the Hscript expression language, you use $ to evaluate local variables, just like how you evaluate global variables. In Python, you use the lvar function. So, the Python equivalent of $TX is lvar(“TX”).

… which is exactly what I was looking for.

Greg
  • Quick Links