Python to Vex

   16744   5   1
User Avatar
Member
5 posts
Joined: 3月 2018
Offline
Good morning from Sydney,

I am new hobby student of Houdini, coming from 3DSMax, Blender and Quixel, 2 weeks in and so far just loving it.

However, I have a totally common issue as anyone else. I am running Houdini 16 and all those great tutorials are from version 15 or older. All these lecturers are using Python (or is it HScript?) language in fields that are already operating in VEX only. I was able to find list of different variables for Python through Houdini Help, but I totally fail to find similar thing for VEX. Googling for help, I have found common problem everyone bash their head into like $N is `npoints(0)-1` and few (only few!) others and it felt more like solving an adventure game problem. But when I come across something new for fifth time and google won't spit out any answers anymore (I reckon those people either got better then me and kept figuring it out on their own, or they simply gave up with those tutorials, who knows xD) then its becoming frustrating. And all I would need is just some simple Python (or Hscript) to VEX translation spreadsheet. Or at least some list of most common local variables from VEX!

Aye, there is an alternative solution - get into studying VEX! But I am very bad at coding, last thing I did is Pascal and its totally boring for me. I am getting used to that I will have to learn some of it later (I have already checked Rohan Delvi's Intro to VEX and its next on my to do list after I finish his Rocket. And it almost broke my heart that I had to tuck it in between his rocket and Engine hard surface modeling).

Please, is anyone aware of list or spreadsheet of this kind? Or would anyone bother to create one and put it on the web, or even perhaps make it accessible in common Houdini help?

Thank you
Jan
User Avatar
Member
5 posts
Joined: 3月 2018
Offline
I am usually trying to work with this page

http://www.tokeru.com/cgwiki/?title=HoudiniVex [www.tokeru.com]

but trying to figure out which VEX is which Python takes forever and it doesn't make much sense to me either.
User Avatar
Member
8037 posts
Joined: 9月 2011
Offline
There is no such one-to-one mapping that would make such a spreadsheet viable. You tend to solve problems differently in VEX.

It would be better to be a VEX-native and disregard older tutorials that use obsolete methods.

There are plenty of good VEX-centric tutorials out there, so I won't list them here.

Instead, as you start to use vex in wrangles and expressions, the reference guide is best to consult for quick answers about specific functions.

http://www.sidefx.com/docs/houdini/vex/functions/index.html [www.sidefx.com]
http://www.sidefx.com/docs/houdini/vex/index.html [www.sidefx.com]

Most nodes still do not use vex for their expression language. For most nodes, you will continue to use hscript expressions, and when there is no other way (such as complex string formatting and other logic) Python. The few nodes that do use vex are the group/point expression nodes, which come with a few examples built in to the interface, dop microsolvers with vexpressions, and wrangles which are pure vex nodes, generally meant for users that are already well-versed in the language.

If you find specific cases of the older expression-based nodes, such as the old point and group sops, that you are having trouble translating to the newer vex alternatives, feel free to post questions here and someone will be happy to help.
Edited by jsmack - 2018年4月2日 19:03:40
User Avatar
Member
5 posts
Joined: 3月 2018
Offline
Aye mate, thanx for the answer. I was a bit afraid that that would be the case that Hscript can't be so easily translated into VEX although sometimes it works (as stated example for $N).

To be honest I am quite having a trouble to find comprehensive tutorial in H16. I am signed to pluralsight.com and John's Moncriefs intro to Houdini was my starting point. He uses even older version then 15, I believe he has 12 or 14 or something like that? And that's most of the introductory type of tutorials that I was able to find (before I found Rohan's series). I can't find “all around basic functions aware beginner tutorial” like those from Rohan Delvi (his Rocket is just a perfect semi-beginner/semi-intermediate tut for me) just made from H16. Doesn't mean that there aren't any, maybe just my google wording is bad xD. And next step is probably Steven Knipping in upcoming months that I am aiming for now. I think he did most of his tuts in 15 aswell. Haven't bought any yet to truly check it out, it's too advanced for me now.

But I will follow your advice and try to filter out new H16 tuts or ask questions here then.
User Avatar
Member
806 posts
Joined: 10月 2016
Offline
Moin,

I am not quite sure I completely got the problem you are facing. If you aren't sure about what code snippet is Python and what is VEX, just have a look at how conditional clauses end - Python has a colon (“:”) and almost all other languages (including VEX) don't. Python uses indentation only, almost all other languages use brackets (curly ones, usually - { and } ). You should be able to spot which language a code snippet is in by looking at it in most cases if the choice is Python or not Python :-)

As for “age of tutorials”: I do get that problem to some degree. However, I think you are taking the wrong approach here. A tutorial shouldn't be a “copy me and get rich” documentation but an explanation of how things work. They should make you understand the ways to USE the tool.
Those ways haven't really changed a lot over the time. Yes, nodes may behave differently, new nodes have been added, the programming language used in nodes may have changed - but at its core, Houdini is about controlling points. My advice would be to separate the programming stuff from understanding Houdini's “usage logic” and not intertwine both like “you HAVE to learn VEX in order to use Houdini”.

Actually, in my world watching a tutorial and then trying to redo it ON YOUR OWN, just following the general outline but “researching” your way through the current version of the software (or a completely different software for that matter) is the best way to LEARN something based on tutorials. Just copying what is being done in the video has never ever worked for me if I wanted to LEARN something …

Just a thought, though.

Marc
---
Out of here. Being called a dick after having supported Houdini users for years is over my paygrade.
I will work for money, but NOT for "you have to provide people with free products" Indie-artists.
Good bye.
https://www.marc-albrecht.de [www.marc-albrecht.de]
User Avatar
スタッフ
3459 posts
Joined: 7月 2005
Offline
if you open a Textport (Windows > Hscript Textport)
and type:
help
you'll get a list of commands
and if you type:
exhelp
you get a list of expressions

then type:
help nameOfCommand ( or exhelp nameOfExpression)
and you'll see the help…
and for many of these you'll see something like this:
/ -> help otedit
otedit

    REPLACED BY
      - hou.ui.openTypePropertiesDialog()

this is handy when trying to transition to to python.
Michael Goldfarb | www.odforce.net
Training Lead
SideFX
www.sidefx.com
  • Quick Links