Question on learning scripting/language/expression

   10655   6   1
User Avatar
Member
55 posts
Joined: July 2005
Offline
Dear All,

I would like to have some suggestions on picking up scripting/language/expression for Houdini. I have no language background nor having a math brain but I really want to do more in Houdini.

Houdini Doc is the best help; however, it sometimes doesn't go as basic…. I just asked a question regarding modulus operator (%) in the forum and I feel really stupid for even asking everyone to help on that. I did search and found out the usage with pulse expression and what it means in javascript and such though I still don't know where to go next in Houdini.

OK, so my question would be how do I learn Expression? I mean….is that a language its own? Is it the same thing as in Maya and After Effects, and java related?

Although the doc says Expression is old and will be replaced, it is still being widely used as well as in tutorials. And same to HScript, so instead I will be focusing on Python since HOM is using Python too…. I have tried to simplify the list of languages in the following, which limited down to Expression, Python, and VEX

Expression (“old scripting language” but still widely used)
HScript (“old scripting language”)
Python
Python Expression (Basically Python?)
HOM (using Python)
VEX

I read some chapters on Python but always got dragged away by some exercises, which always makes me wonder if they will be anything to do with Houdini (I know they do eventually) and really who knows how long will it take for me to get back working on Houdini.

Has there been book published on HScript, VEX, or HOM? Maybe I need a book on Expression, too.

Another problem is every time I am catching up a tutorial, I realize that the workflow has been changed or the functions are no longer there between versions, which really sucks and kept stopping me.

I would like to study the language books if there are any but I am afraid that I will take forever to go through them, which by the time Houdini might be evolving into using another language, hahaha.

Please let me know if you have experience going through or any suggestion would be great help along the way.

Thanks, guys!

David
User Avatar
Member
52 posts
Joined: Jan. 2009
Offline
Hi David,

I'm from a similar background - useless at Maths, never done any coding and come from a 3DSMax background where all the nasty expressions and fiddly code are kept well, well, well away from the user.

I've been using Houdini for a couple of years now as a hobbyist and the only real advice I can give is that, in time these expressions will start to make sense. A lot of sense - eventually you'll wonder how you lived without them and actively seek out new expressions to play with. I know how daunting it is and i'm only just starting to become comfortable with them.

whenever i come across a new expression or variable the first thing I do is open up a textport window and ‘exhelp’ it (exhelp chramp - for example) or if its a node i'm unfamiliar with pull up the help card - very useful. There are no shortcuts i'm afraid, it just takes time, and trial and error - but on the plus side, it's very rewarding.

I practically high-five myself when I realise, that without thinking about it, i've just written a huge wedge of code!

IMHO - time, exhelp, tutorials and learning thru use and repetition are the key.
User Avatar
Member
55 posts
Joined: July 2005
Offline
Thanks for your suggestion, Benchboy!

In fact, I do feel a bit more familiar when putting up together an expression compare to when started. Although they don't work all the time, I am experimenting along the way and will be hitting exhelp a lot more now. Community has been great, especially with people like you sharing thoughts and tips, really appreciated.

Thanks again!

Sincerely,

David
User Avatar
Staff
3455 posts
Joined: July 2005
Offline
one way to help with expressions is to use the textport
instead of running the expression in a parameter - test it first in the textport
this will give you some feedback on errors and you can very quickly find help with “help” “exhelp”
Michael Goldfarb | www.odforce.net
Training Lead
SideFX
www.sidefx.com
User Avatar
Member
694 posts
Joined: March 2009
Offline
It really helps to go slowly, if you have a pressing issue just solve it the way you can, whether it looks dirty or non-houdini, just go for it!
Once you get it working and know why it works, go back and ask yourself where you could improve, little bits at a time. Maybe there's an expression that returns the name of a point group from another node rather than you have to type the group's name every time… maybe there's a way to use a python SOP to accomplish a task I already solved with 5 other SOPs. All in name of learning and no rush.
It might take quite some time before you really need to use complex expressions for anything and that's fine. Don't feel pressured to do things the “hard way” just because some people do.
Toronto - ON
My Houdini playground [renderfarm.tumblr.com]
“As technology advances, the rendering time remains constant.”
User Avatar
Member
133 posts
Joined: July 2005
Offline
Hey Dave:

There's an old tutorial series on the 3D Buzz site on expressions that is a good place to understand how they work. You'll have to join the site first. The lessons are called Expressions I and Expressions II. It's an older version of Houdini, but should be still good.

http://www.3dbuzz.com/vbforum/sv_showvideo.php?v=770 [3dbuzz.com]

* Hscript - think of this as a way to script any action you perform in houdini. Want to change the color of a node? Hscript has a function for that. Want to wire some nodes? You can do it via hscript. Look at the ‘opscript’ function. It'll give you the hscript command that generated a node! Good way to learn!

* Expressions - this is technically still hscript, except that they return some sort of value, specifically executed from within a parameter/channel. For example, you can use a noise() function to animate an object in the translate parameters.

Start with these for now. They are simpler to get into than python, IMHO, since they're straight forward. As soon as you reach limits, you'll be all “I want to do MORE.” Then it's time to move over to python. Python performs both of the functions of hscript and expressions and more, since it's a real programming language.

If you want to dive into python, there's a good Rubik's cube demo on the cmivfx site.

Hope all this helps. Keep working at it. DO NOT be afraid to ask the simplest questions. Takes courage to reveal ignorance in the interest of growth.
Francisco Rodriguez
Effects Animator | Walt Disney Animation Studios
User Avatar
Member
55 posts
Joined: July 2005
Offline
I got the ideas of what they are and for now, thank you so much guys!

I am definitely much more confident than ever! From building otls, especially, I actually feel closer to the program by using some easy expressions here and there and really want to know more. Well, still a long way to go and I shall not rush, right? Thanks again guys, really had no idea where to look and start this journey.

Sincerely,

David
  • Quick Links