Jump to content

Multithreading in Houdini

Recommended Posts

3 hours ago, art3mis said:

Came across this long article on multithreading in Houdini.

Can any VEX perts tell me whether this is still relevant? Especially with the H16 release?


That's a chapter from the book https://www.amazon.com/Multithreading-Visual-Effects-Martin-Watt/dp/1482243563

It's written Jeff Lait the Senior Mathematician at SESI.  It's a good book, it's definitely worth reading... and it is definitely still relevant, a lot of it is the theory behind how Houdini works and how multi threading works in Houdini and the challenges thereof. 

However will it really help you with VEX?  Probably not.


Share this post

Link to post
Share on other sites

I also have a question regarding multithreading in wrangles (or for loops in general in houdini).

I want to create a line between two points in a wrangle node according to their attributes but it creates two lines, one for each point i want to connect. The add SOP does it correctly.

Is there something I'm just obviously missing or doing wrong?

Here's a quick example:




Edited by Gorrod
edited file

Share this post

Link to post
Share on other sites

In your Detail mode version you are still looping over two points, that is why you are generating two lines. Instead gather up the two points you want to connect and simply issue one line per set of points.

In your Points version there is no need to wrap the entire logic in an IF statement that filters by group. You have already selected the group using the outer node group field.


Edited by Atom

Share this post

Link to post
Share on other sites

Thanks Atom, I still have a question though...

I tried to change the connectMe attribute for the condition in the "Points" version so that the twelfth point does not create a line also.

So when the wrangle loops over the point with ptnum == 2 it changes the connectMe attribute and the tweltfth point does no longer meet the requirements for creating another line.

I tryed to break down the problem and probably failed a bit to present it correctly...


From my understanding the for loop should go over the point 2 first, change the condition attribute of the 12th point which then no longer meets the requirement and does not get processed at all. 

But the for loop and the point wrangle both process the points at the same time, so they both meet the requirements for the if statement and create two lines instead of one.


So basicly what i want to do is go over the points one by one, starting at a point and then moving on to the next one (so I can change an attribute of a point while iterating through another one). I tried that using a for loop and the point wrangle, but neither seems to work that way.




Share this post

Link to post
Share on other sites

If you are in running in any mode other than detail mode, the entities do not know about what is processed on the other entities.
I personally like to think of VEX per points or primitives, as a shader language, as it uses a lot of the same logic.

In detail mode, you can basically treat it as most other languages, Java would be a language that is one of the most close to VEX I think.

So if you want have your wrangle do operations based on iterative results of the different objects (points/primitives) you either need to put the wrangle in a forloop,
use detail mode instead, or revise you logic, so it would be compatible with "shading-logic" ;)  

Edited by acey195

Share this post

Link to post
Share on other sites

I guess I just have to adjust my logic to the way point wrangles and for loops are working in VEX then, thank you acey!

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now