Expressions, best practice

   3441   5   3
User Avatar
Member
4 posts
Joined: 7月 2013
Offline
Hey guys. I have left Houdini funs for a couple of years and back to them just a few days ago. Have found tons of new functionality and just a one question now is about expressions. Are you going to deprecate hscript expressions and leave them just for a backward compatibility? Is there any reason to use only python in expressions instead of hscript?
Edited by - 2013年7月7日 15:02:49
User Avatar
Member
7046 posts
Joined: 7月 2005
Offline
Hscript for expressions is much faster… so if you expect the expression to be called often or repeatedly, use Hscript. However, Python is much more powerful a language, so for sure use it for scripting.

CHeers,

Peter B
Cheers,

Peter Bowmar
____________
Houdini 20.5.262 Win 10 Py 3.11
User Avatar
Member
4 posts
Joined: 7月 2013
Offline
Hey Peter. Thanks for pointing that out. Can you explain a little why hscript is much faster? Is python just wrapping around hscript and HDK?
User Avatar
Member
316 posts
Joined:
Offline
For expressions that need to work quickly for multiple prims/points/vertices there are also the new *Wrangle SOPs, which are meant to replace some of the functionality of the Point/Primitive SOPs. There are new “point”, “prim” and “detail” VEX functions that can be used like the hscript equivalent.

From what I understand hscript would be very hard to multithread so it's speed will become more limited as time goes on and performance increases come by way of more CPU cores rather than speeding up single CPU speeds.
User Avatar
Member
4 posts
Joined: 7月 2013
Offline
Like the sound of that. Will look at that functionality. Thanks.
User Avatar
Member
36 posts
Joined: 10月 2011
Offline
In the tutorial “VEX Wrangle Workshop” http://www.sidefx.com/index.php?option=com_content&task=view&id=2512&Itemid=132, [sidefx.com] Ari Danesh said because of Houdini is built on VEX, using HScript will be faster if only want to play inside Houdini.

However, Python is a “Pipeline” language and has many powerful modules, so use it if want to communicate with other software or need to program seriously.

Also, the new Point Wrangle SOP is 10x faster than the Point SOP!
  • Quick Links