VEX / VOPs Basics: PCFind

comments 13
Free Tutorials

One of the top three questions we’ve been asked during season one was “How does PCFind work?!” and indeed the question is important as so many setups rely on the ability to find close points.

This week’s tutorial is not so much about a certain setup or effect but more about the basic understanding of how pcfind works in VEX and VOPs. Getting a deeper understanding of this function will also benefit you in several upcoming tutorials we’ve got prepared for you.

Liked it? Take a second to support Moritz on Patreon!
Become a patron at Patreon!

13 Comments

  1. Masterheavy

    very nice !
    what if we would like to animate?
    do we have to put that wrangle node in a sop solver?

  2. @master heavy
    you can create a float channel parameter on wrangle node and replace the float value inside the function with a channel reference for example :

    pcfind(0, “P”, pos, ch(“radius”), ch(“max_number” ));

    then you can key frame the actual parameter or drive it with any expression.

    • Masterheavy

      thx for the reply but i would like to avoid keyframing parameters. and channel referencing in wrangle nodes is great.
      maybe i did not expressed myself clearly – my thoughts was animating the startobject – so animating pos without loosing the pos we already got in the first frame eg. the frame before.

      • yep in that case you can use solver. I am a fan of stuff like growing patterns and branching stuff, and I found out that by storing previous frame values to utilize over next frame inside solver is a very decent way.

  3. Very clear, nicely done 🙂 For increased clarity you may want to stay away from referring to point numbers as IDs, since “id” is a common attribute name. Great work as always!

    • You’re totally right. Thanks for pointing it out. The proper term would have been “point number” apologies for that – gonna try and stick to it in future recordings 🙂

      Cheers,
      Mo

  4. Love your stuff, one thing i noticed is that if you run over the the sample point instead of every point on the grid you should get quite a significant performance boost as houdini would only need to calculate the pcfind function once instead of 100×100 times.

    Anyway, keep up the good work and thank you for your hard work! 🙂

    • You’re absolutely right, David – thanks for the input. As mentioned in the comments on vimeo I decided to do it this (admittedly extremely inefficient) way as this would yield almost the exact syntax as what I’m going to use in a few upcoming tuts.

      Cheers,
      Mo

  5. Michael Gaskin

    Just wanted to say thanks for the tutorial… I’ve only been using Houdini since GDC 17 and I am just blown away at how powerful it is…. This and your other tutorials are easy to follow and understand, a great combination. Thanks again for all that you guys do!

  6. But, why you could need to iterate for all the points in a point vop?? You could do even through a attribute wrangle through detail and run once… right? I say that because you are doing a loop inside, and you don’t need to loop anymore… So, what do you think Moritz??

    • I might not be getting your point here – but there are quite a few cases in which you’d like to iterate over all points in a given geometry stream. Take infection/growth solvers for example: You’d like to check if there are any infected points in the vicinity of each individual point. Thus it’s highly beneficial if you can set a node to iterate over all points in a given geo stream (and even do so multithreaded).

      Cheers,
      Mo

Leave a Reply to Milad.Savar Cancel reply