To VEX, or not to VEX...?

   6576   10   3
User Avatar
Member
210 posts
Joined: 1月 2014
Offline
I have a few questions concerning VEX.
This is a bit convoluted so I hope this doesn't lead to too much confusion.

VOPs are frequently described as the visual way to programm VEX so I was wondering how consistent this is. Is it really so that EVERYTHING I can do with writing VEX, I can also do with VOPs. In other words: Is there any need to learn VEX, when I can do everything visually with VOPs?
I'm asking this question for a specific reason. A while ago I was mailing with SESI support they/he/she said they are going to drop HScript eventually because they are leaning towards VEX entirely. So from this point it would make sense to learn VEX syntax and stuff, because if Houdini would rely on that completely this would be a nice consistency. On the other hand I saw this tutorial here
https://www.youtube.com/watch?v=AdXTGD46L1M&index=32&list=PLShEm1_z6_cyBOAKQSH2ck-enGSnovMjD [youtube.com]
and somewhere at about 6:30 he says that Python is going to replace VEX some time, so it would make more sense to learn Python instead of VEX. This would be very convinient for me since I am already familiar with Python and so I don't have to go for the struggle learning new syntax and stuff.
So the questions are:
1. Which one is true? Will HScript be dropped, or VEX, or Python?
2. If VEX will not be dropped, is there any need to learn it when, apparently VOPs are capable of doing everything VEX can do? Is there any case were I would have to write VEX in particular because VOPs are not capable of this whatever task?
User Avatar
Member
4530 posts
Joined: 2月 2012
Offline
1. VOPs are not complete. There are a lot of cases where VOPs don't have the equivalent functions available in VEX. The other way around is also true sometimes, but less common.

2. Reading VOPs takes more time for complex networks than VEX code IMO.

3. If you don't know VEX, you won't be able to use Snippet, Inline VOPs, nor VEX based custom SOPs.

4. If you don't know VEX, you won't be able to use Wrangle SOPs, and they are used all over the built-in nodes. So you won't be able to understand these when exploring the internals of the default tools.

5. Hand crafted VEX code is a lot more concise than the equivalent created in VOPs.

6. VEX is parallel, Python is not.

7. I am not SESI but VEX is so deeply integrated into Houdini that it's impossible for it to be destroyed. If it replaces hscript, that would be good news for me as it would open up more possibilities in Houdini.
Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com]

youtube.com/@pragmaticvfx | patreon.com/animatrix | pragmaticvfx.gumroad.com
User Avatar
Member
210 posts
Joined: 1月 2014
Offline
1. Okay cool, that sounds like a clear statement.

3. & 4. That's the question. I might not be able to do this currently but if it is true what the instructor in this video says and VEX will be dropped some day, there gotta be alternatives then. I don't know where he got that info from, it's just so contradictory to what I've heard from SESI support, that it got my attention.

7. I'm not against VEX. I would also welcome if HScript gets dropped. The less scripting languages to deal with, the better I think. It helps the overall consistency and thus makes it easier for new users.
But clarity would be nice, because I don't wanna dive deep into VEX now and in a few years it's removed.
User Avatar
Member
637 posts
Joined: 6月 2006
Offline
HScript is the old scripting language from houdini and when you know shell scripting it's easy to learn. :-)

when i see that vex uses llvm to compile the code i don't think they replace it because the speed what you get is near c/c++ code and that's the target. i don't know if they make the python code same as what fabric is doing to run python code fast with there KL code.

in the future is that most nodes will be in vex like that every optimization or new cpu command in the compiler will affect all that vex code. a llvm gpu support can affect all that written vex code in c/c++ you must optimize by hand and that's a huge time saver.

Links:
http://fabricengine.com/kernel-language/ [fabricengine.com]
http://fabricengine.com/fabric-and-llvm/ [fabricengine.com]
User Avatar
Member
4530 posts
Joined: 2月 2012
Offline
Kim is a well known Houdini artist but I wouldn't worry about VEX disappearing. Even if it does, VEX syntax can be learnt in a single day if you are familiar with C style languages. And if you are not, being familiar with C style languages always comes in handy.
Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com]

youtube.com/@pragmaticvfx | patreon.com/animatrix | pragmaticvfx.gumroad.com
User Avatar
Member
7025 posts
Joined: 7月 2005
Offline
Yeah I can't see VEX replacing Hscript. Python isn't even close to replacing Hscript after 4+ versions, so I think Hscript is here to stay for quite a while.

Having said that, if you have a choice, learn Python for making your own tools and possibly your own operators. VEX is better for operators though, it's much faster. However, Python is more flexible than VEX since VEX is designed for concurrent (threaded) execution, so there are a number of things it just can't do.

Hscript expressions are still better (faster, less typing, easier to understand) than Python expressions though. To be clear, an Hscript expression is where you see a channel reference like ch(“../somenode”). You can do that in Python expressions but it's super ugly and unintuitive.

I prefer VOPs over Wrangle or pure VEX because it avoids the arcane syntax issues that the Wrangle nodes have, you're much less likely to make typos and it's way way faster to prototype something and build a UI.

However, a complex VOP network does start to bog down in terms of debugging and being understandable. I find that I dump out the .vfl code (the VEX source) from VOPnets when they get complicated and then go into the code to debug. To each their own though.

So to summarize: Learn everything, but IMO learn VOPs first for quick rewards, then VEX when you need more complicated things, then the Wrangle details.

For tool building, learn Python and whatever bits of Hscript you'll need that aren't implemented in Python (quite a lot, unfortunately) and also Python for creating Nodes, but only if VEX can't do it.

That should keep you busy for a weekend at least

Cheers,

Peter B
User Avatar
Member
2624 posts
Joined: 8月 2006
Offline
I must say Python is my weapon of choice for creating layout from bunch of nodes or predefined assets

ie create a shelf > run your python to prefill a mantra rop with all your image planes / outputs / settings etc . Which can be rolled out show wide


Rob
Gone fishing
User Avatar
Member
339 posts
Joined: 8月 2007
Offline
Just to add a different viewpoint: I'd stick with VOPs for the most part. You will pick up VEX along the way. If you LOVE coding then you probably wouldn't be asking this question, right?

Advantages:

*You don't need to worry about syntax, if your vopnet doesn't work it's because your logic is wrong rather than a missing semi-colon/misspelled argument.

*If you keep your networks clean they will be more readable than a big block of code, vops makes it easy to see what attributes are being written to and trace back the connections from there.

*Vops is great for figuring out which vex command you need, (open Type Properties on the node and go to the code tab)

*While it's correct that vops is incomplete, it is mostly complete. By the time you run into something you can do in vex but not vops, you will likely be experienced enough to work it out
Jesse Erickson
Fx Animator
WDAS
User Avatar
Member
210 posts
Joined: 1月 2014
Offline
pbowmar
Yeah I can't see VEX replacing Hscript.
I don't know, I'm just repeating what SESI support said to me.

pbowmar
Hscript expressions are still better (faster, less typing, easier to understand) than Python expressions though. To be clear, an Hscript expression is where you see a channel reference like ch(“../somenode”). You can do that in Python expressions but it's super ugly and unintuitive.
Although ch() works in Python just alike, I know what you mean. The reason I was mailing with SESI support initialy was, I was logging a feature request to bring HScript and Python closer together. Something like $PR = pr(), $F = f()…and so on, similar to Maya where there are exact equivalents between MEL and Python. If that would be the case, I probably wouldn't have touched HScript up to this very day. They said this is not going to happen because it would destroy the describtive nature of Python.
I would prefer Python but having to type lvar(“PR”) for every $PR indeed is a struggle and that's still relatively close compared to other writearounds.

tjeeds
If you LOVE coding then you probably wouldn't be asking this question, right?
No, it's not that don't like coding, it actually can be a lot of fun but I'm a 3D artist first and a coder in second place. I was just asking because I don't wanna waste my time on learning a lanquage like VEX, when I hear that VEX is going to be dropped some day. Then I would rather stick with Python, that's something I'm familiar with. I started to like the idea that HScript will be dropped to make room for a more VEX centered workflow but as it seems we have to keep dealing with 3 languages for the time being.
User Avatar
Member
7735 posts
Joined: 7月 2005
Offline
I agree that the scripting situation in Houdini is somewhat confusing. There's actually 4 (not 3) “languages” that one can use in Houdini:

- hscript command language: opls, opadd, opparm, etc…
- hscript expression language: ch(), sin(), etc…
- Python (which can be executed as commands or as expressions)
- VEX

I won't repeat too much about the differences as others have already pointed this out. Like everything else in the real world, the different languages have different pros and cons. IMHO, I'd like to see Python completely replace the hscript command language because as a scripting language, it's superior in every way. In terms of expressions (ie. the language that gets evaluated from parameters) though, I wish that Python was better but in practice, it has turned out to be far too slow. And as far as I can tell right now, it'll probably be never faster/better than what we can hand tune in hscript expressions.

VEX is not a “scripting” language per se, but more of a shading language [en.wikipedia.org] that's used for SIMD processing like OpenCL, GLSL, CUDA, etc. So it's niche in the 3D pipeline is quite different. That's not to say one cannot extend VEX so that it is more like a general purpose language but doing so might cause it to lose the intrinsic advantage of why it was good in the first place.
User Avatar
Member
1532 posts
Joined: 7月 2005
Offline
There is tremendous insight in these posts.

Learn it all. You'll need it.

G
  • Quick Links