what's difference between vex, hscript, expression, python?

   16477   12   2
User Avatar
Member
10 posts
Joined: 6月 2014
Offline
Anyone can give a clear explanation to new users like me what those languages (VEX, Hscript, expression, python) are used for?
User Avatar
Member
10 posts
Joined: 6月 2014
Offline
I mean it's kinda confusing to me why there be several different ones in one software
User Avatar
Member
1391 posts
Joined: 12月 2010
Offline
Expressions : is some of codes that useful in the channels (parameters) for controlling them.for example $F return current frame number to the some parameter or npoints(“..”) return number of points for specify object to the some parameters or channel.(It's like expressions in the Maya)

HScript : is old Houdini scripting languages , it's pretty like to Shell Scripting in OS , we can have access to the Houdini with this tool , for example we can add new nodes , or delete nodes , changing display flag or etc.
We should write HScript commands in the Window->HScript Textport
(It's like MEL in Maya)

Python : is new feature for accessing to the Houdini exactly like HScript.we can add New nodes , delete them , edit them ,access to GUI or etc.
Also we can create new custom nodes with Python.

VEX : is a powerful languages for writing new shaders and custom nodes.It's pretty like to C/C++ codes.It's so faster than Python and HScript , even I think in some special cases it can faster than C/C++ tools !!!
we can write VEX codes with two way :
1. writing VEX codes words (like Python , Expressions , HScript)
2. writing VEX codes with Visual Nodes !
in the second method we can write our program only with visual nodes !
for example for writing A * B = C we should add two node for A and B , then add Multiply node and connect A and B to it's inputs , finally connect output of the Multiply node to C node.
We calling this method(Visual) VOP.
VOP nodes are same for different networks (SHOP,POP,OBJ,CHOP,COP,…) , but imported parameters are different for each networks.
for example in the Geometry Network we have P parameter for importing Position of the points , But in the COP network we should have R , G , B parameter for importing RED , GREEN and BLUE to the VOP Network.
So we have different VOP Network for differents Networks such as :
VOP SOP , VOP COP , VOP CHOP , VOP POP and etc


NOTE1 : We can write Python codes as Expression for channels and parameters too , But standard Houdini Expressions is faster than Python Expressions.

NOTE2: We can do some special things with many languages (Python - VEX - HScript).for example we can create a custom node for deforming a geometry with Python and VEX , But VEX is very very faster than others !
Edited by - 2014年10月30日 20:07:06
https://www.youtube.com/c/sadjadrabiee [www.youtube.com]
Rabiee.Sadjad@Gmail.Com
User Avatar
Member
1391 posts
Joined: 12月 2010
Offline
Of course we have some other tools for programming in Houdini like HDK for writing C/C++ codes or even we can use Python for doing that (HOM).

They are just my experience and opinions , I hope they are correct , But you can find your better answer from real Houdini's Masters like Jeff or edward 8)
https://www.youtube.com/c/sadjadrabiee [www.youtube.com]
Rabiee.Sadjad@Gmail.Com
User Avatar
Member
443 posts
Joined: 9月 2012
Offline
HScript is the Houdini’s old scripting language. Python Scripting with the Houdini Object Model (HOM) is new and preferred over HScript which is still available in Houdini so that older files and scripts may work properly.
Hscript expression are easy and fast to write compare to python expressions. I don't think python expressions are slow. You can use either of them.
VEX is for modifying object data not for creating. If you want to create data then there is another flavour called CVEX which is slightly faster but has less functionality. VEX is faster then hscript expression and multi-threaded. In all context of Houdini you have VOPs. Houdini's shaders are written in VEX (VOPs).
VOPs require you knowledge of maths at least basic knowledge so you can understand and create the logic inside VOP.
User Avatar
Member
1391 posts
Joined: 12月 2010
Offline
PradeepBarua
I don't think python expressions are slow. You can use either of them.

No , Python expressions are slower than standard expressions !
If you wanna write an expression for too many point's or objects , you should use standard expressions.
Python expressions are good when we don't wanna executing our expressions too many times on each frame ,they are good specially for controlling parameters , File and Path management and like so,
Because Python has cool features for doing that , for example working with strings is very simple in python , we can have dictionary or etc.

Just check attached project . (e.g cooking times for second example are : Standard Expressions : 132.63 ms
Python Expressions : 1.229 s !)

Attachments:
JK_Python_Exp_Speed.hip (95.1 KB)

https://www.youtube.com/c/sadjadrabiee [www.youtube.com]
Rabiee.Sadjad@Gmail.Com
User Avatar
Member
72 posts
Joined: 3月 2014
Offline
PradeepBarua
I don't think python expressions are slow.

Oh , Man !
That's obvious Python expressions are slower !!!
I knew this before in the Python in Houdini tutorials from FXPHD !
User Avatar
Member
72 posts
Joined: 3月 2014
Offline
Joker386
Expressions : is some of codes that useful in the channels (parameters) for controlling them.for example $F return current frame number to the some parameter or npoints(“..”) return number of points for specify object to the some parameters or channel.(It's like expressions in the Maya)

HScript : is old Houdini scripting languages , it's pretty like to Shell Scripting in OS , we can have access to the Houdini with this tool , for example we can add new nodes , or delete nodes , changing display flag or etc.
We should write HScript commands in the Window->HScript Textport
(It's like MEL in Maya)

Python : is new feature for accessing to the Houdini exactly like HScript.we can add New nodes , delete them , edit them ,access to GUI or etc.
Also we can create new custom nodes with Python.

VEX : is a powerful languages for writing new shaders and custom nodes.It's pretty like to C/C++ codes.It's so faster than Python and HScript , even I think in some special cases it can faster than C/C++ tools !!!
we can write VEX codes with two way :
1. writing VEX codes words (like Python , Expressions , HScript)
2. writing VEX codes with Visual Nodes !
in the second method we can write our program only with visual nodes !
for example for writing A * B = C we should add two node for A and B , then add Multiply node and connect A and B to it's inputs , finally connect output of the Multiply node to C node.
We calling this method(Visual) VOP.
VOP nodes are same for different networks (SHOP,POP,OBJ,CHOP,COP,…) , but imported parameters are different for each networks.
for example in the Geometry Network we have P parameter for importing Position of the points , But in the COP network we should have R , G , B parameter for importing RED , GREEN and BLUE to the VOP Network.
So we have different VOP Network for differents Networks such as :
VOP SOP , VOP COP , VOP CHOP , VOP POP and etc


NOTE1 : We can write Python codes as Expression for channels and parameters too , But standard Houdini Expressions is faster than Python Expressions.

NOTE2: We can do some special things with many languages (Python - VEX - HScript).for example we can create a custom node for deforming a geometry with Python and VEX , But VEX is very very faster than others !


Wooow , Great and perfect answer , thanks
User Avatar
Member
443 posts
Joined: 9月 2012
Offline
No , Python expressions are slower than standard expressions !

My bad, I take it back……….
User Avatar
Member
1391 posts
Joined: 12月 2010
Offline
PradeepBarua
No , Python expressions are slower than standard expressions !

My bad, I take it back……….


No problem my friend :wink:
https://www.youtube.com/c/sadjadrabiee [www.youtube.com]
Rabiee.Sadjad@Gmail.Com
User Avatar
Member
1 posts
Joined: 3月 2023
Offline
Sadjad Rabiee
Expressions : is some of codes that useful in the channels (parameters) for controlling them.for example $F return current frame number to the some parameter or npoints("..") return number of points for specify object to the some parameters or channel.(It's like expressions in the Maya)

HScript : is old Houdini scripting languages , it's pretty like to Shell Scripting in OS , we can have access to the Houdini with this tool , for example we can add new nodes , or delete nodes , changing display flag or etc.
We should write HScript commands in the Window->HScript Textport
(It's like MEL in Maya)

Python : is new feature for accessing to the Houdini exactly like HScript.we can add New nodes , delete them , edit them ,access to GUI or etc.
Also we can create new custom nodes with Python.

VEX : is a powerful languages for writing new shaders and custom nodes.It's pretty like to C/C++ codes.It's so faster than Python and HScript , even I think in some special cases it can faster than C/C++ tools !!!
we can write VEX codes with two way :
1. writing VEX codes words (like Python , Expressions , HScript)
2. writing VEX codes with Visual Nodes !
in the second method we can write our program only with visual nodes !
for example for writing A * B = C we should add two node for A and B , then add Multiply node and connect A and B to it's inputs , finally connect output of the Multiply node to C node.
We calling this method(Visual) VOP.
VOP nodes are same for different networks (SHOP,POP,OBJ,CHOP,COP,...) , but imported parameters are different for each networks.
for example in the Geometry Network we have P parameter for importing Position of the points , But in the COP network we should have R , G , B parameter for importing RED , GREEN and BLUE to the VOP Network.
So we have different VOP Network for differents Networks such as :
VOP SOP , VOP COP , VOP CHOP , VOP POP and etc


NOTE1 : We can write Python codes as Expression for channels and parameters too , But standard Houdini Expressions is faster than Python Expressions.

NOTE2: We can do some special things with many languages (Python - VEX - HScript).for example we can create a custom node for deforming a geometry with Python and VEX , But VEX is very very faster than others !

Wow, that was really helpful! Thank you so much for taking the time to explain everything in such an understandable way.

As someone who is just starting out with Houdini, do you think it would be more beneficial to focus on learning VEX instead of other languages like Python? Or do you think it's important to get a good understanding of all the languages used in the software in order to master it?

Thanks again for your insights!
User Avatar
Member
2129 posts
Joined: 9月 2015
Offline
rubens.ab.filho
As someone who is just starting out with Houdini, do you think it would be more beneficial to focus on learning VEX instead of other languages like Python?

I would suggest not to bother trying to decided which one to focus on.
Instead focus on what you want to create in Houdini then 'learn' through your projects in which cases one is 'better' than the other to utilize.
User Avatar
Member
665 posts
Joined: 7月 2005
Offline
rubens.ab.filho
As someone who is just starting out with Houdini, do you think it would be more beneficial to focus on learning VEX instead of other languages like Python?

I would suggest not to bother trying to decided which one to focus on.
Instead focus on what you want to create in Houdini then 'learn' through your projects in which cases one is 'better' than the other to utilize.

In general I tend to use VEX the most these days. Definitely like BabaJ says, it's great to have a goal/project in mind to lever against when learning.
  • Quick Links