Expressions, best practice

   3030   5   3
User Avatar
Member
4 posts
Joined: July 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 - July 7, 2013 15:02:49
User Avatar
Member
7025 posts
Joined: July 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
User Avatar
Member
4 posts
Joined: July 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
293 posts
Joined:
Online
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: July 2013
Offline
Like the sound of that. Will look at that functionality. Thanks.
User Avatar
Member
36 posts
Joined: Oct. 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