shameful houdini question

796 views
Skip to first unread message

Steven Caron

unread,
Apr 26, 2017, 1:28:15 PM4/26/17
to soft...@listproc.autodesk.com
i hate to do it but i gotta ask this group because of our shared ICE knowledge...

what is the proper way to get closest points and average their position and update the point position?

pcfind gives me an integer array, but how do i look up those indices and get their point position?

pcopen, then pcimport, do work, then pcexport seems like the right thing to do, should i just ignore pcfind?

thanks
steven

Cristobal Infante

unread,
Apr 26, 2017, 1:38:15 PM4/26/17
to Official Softimage Users Mailing List. https://groups.google.com/forum/#!forum/xsi_list
pcopen > pcfilter (P) will give you the nearest positions.



------
Softimage Mailing List.
To unsubscribe, send a mail to softimage-request@listproc.autodesk.com with "unsubscribe" in the subject, and reply to confirm.

Andy Nicholas

unread,
Apr 26, 2017, 1:57:41 PM4/26/17
to Official Softimage Users Mailing List. https://groups.google.com/forum/#!forum/xsi_list
Yep, what Cris said. Here’s some VEX you can drop in a Point Wrangle if you want to try that approach:

float radius = 1.0;
int maxpts = 50;
int handle = pcopen(0, "P", @P, radius, maxpts);
@P = pcfilter(handle, "P");


To unsubscribe, send a mail to softimag...@listproc.autodesk.com with "unsubscribe" in the subject, and reply to confirm.

Steven Caron

unread,
Apr 26, 2017, 2:07:53 PM4/26/17
to Official Softimage Users Mailing List. https://groups.google.com/forum/#!forum/xsi_list
Thanks guys! I didn't want to use VEX even though I might need to in the long run.

On Wed, Apr 26, 2017 at 10:57 AM, Andy Nicholas <an...@andynicholas.com> wrote:
Yep, what Cris said. Here’s some VEX you can drop in a Point Wrangle if you want to try that approach:

float radius = 1.0;
int maxpts = 50;
int handle = pcopen(0, "P", @P, radius, maxpts);
@P = pcfilter(handle, "P");
On 26 Apr 2017, at 18:37, Cristobal Infante <cgc...@gmail.com> wrote:

pcopen > pcfilter (P) will give you the nearest positions.


On 26 April 2017 at 18:27, Steven Caron <car...@gmail.com> wrote:
i hate to do it but i gotta ask this group because of our shared ICE knowledge...

what is the proper way to get closest points and average their position and update the point position?

pcfind gives me an integer array, but how do i look up those indices and get their point position?

pcopen, then pcimport, do work, then pcexport seems like the right thing to do, should i just ignore pcfind?

thanks
steven

------
Softimage Mailing List.
To unsubscribe, send a mail to softimag...@listproc.autodesk.com with "unsubscribe" in the subject, and reply to confirm.
------
Softimage Mailing List.
To unsubscribe, send a mail to softimage-request@listproc.autodesk.com with "unsubscribe" in the subject, and reply to confirm.


------
Softimage Mailing List.

Andy Nicholas

unread,
Apr 26, 2017, 2:19:07 PM4/26/17
to Official Softimage Users Mailing List. https://groups.google.com/forum/#!forum/xsi_list
Yep, I’m afraid I’m a complete VEX convert now. I never used to be!

Cris, don’t mind me posting stuff like that, I’m just doing it in case it’s useful to anyone who’s trying to get into VEX. Actually, when I was learning to do all the point cloud stuff, I found it useful to see the VEX when I was trying to understand how to hook up the pointcloud VOPs. I (still) don’t think it’s obvious how to do it, especially when you start thinking about if it’s necessary to use pcclose() and where that should be wired.

It’s one of the reasons I moved to VEX, things like “loops" and “if” statements are much easier to understand in VEX than VOPs.

Steven Caron

unread,
Apr 26, 2017, 2:26:05 PM4/26/17
to Official Softimage Users Mailing List. https://groups.google.com/forum/#!forum/xsi_list
So pcfilter has weighting built into it?

I guess I want to customize this weighting should I not use pcfilter? and use pcfind and loop over the particles?

Andy Nicholas

unread,
Apr 26, 2017, 2:39:24 PM4/26/17
to Official Softimage Users Mailing List. https://groups.google.com/forum/#!forum/xsi_list
If you have a look at the docs for pcfilter, it gives you some VEX code that’s the equivalent functionality. You can tweak to suit your needs.

Pasted in from the docs:

- - - - 

float pcfilter(int handle; string channel)
{
    float    sum, w, d;
    float    value, result = 0;
    while (pciterate(handle))
    {
        pcimport(handle, "point.distance", d);
        pcimport(handle, channel, value);
        w = 1 - smooth(0, radius, d);
        sum += w;
        result += w * value;
    }
    result /= sum;
    return result;
}

pcfilter takes the points that were opened by the point cloud and produces a filtered value. The following equation shows how the individual points are weighted.

w_i = 1-smooth(0, maxd*1.1, d_i);

maxd is the farthest point, and w_i is the weight for a given point at distance (d_i). Points that are closer to the center will be weighted higher with that formula, rather than it being an average.

Steven Caron

unread,
Apr 26, 2017, 6:48:52 PM4/26/17
to Official Softimage Users Mailing List. https://groups.google.com/forum/#!forum/xsi_list
OK, great... I can see how to customize it from that snippet.

Just to understand how the power users are using this. Are you using wrangle nodes with vex snippets 100% of the time or are you using the VOP sub graph for somethings?

Steven

Andy Nicholas

unread,
Apr 26, 2017, 7:05:16 PM4/26/17
to Official Softimage Users Mailing List. https://groups.google.com/forum/#!forum/xsi_list
VEX Wrangles nearly all of the time. Usually the only reason I go into VOPs is if a) I need to use something like the Anti-Aliased Noise VOP (which can’t be called as a function directly from VEX), or b) if I’m doing shaders. For some reason I find shaders much easier to deal with in VOPs. I suspect it’s partly because I just haven’t used them enough, plus testing/debugging VEX is generally a bit of a nightmare.

FYI, I’m working on a solution for making noise much easier to use in VEX and VOPs as part of the siLib initiative. I know it doesn’t exactly sound exciting, but from my experience working with existing noise functions in Houdini, I think a lot of folk will find it extremely useful. I’ll explain more when I finish it. Show, not tell :)

Steven Caron

unread,
Apr 26, 2017, 7:16:56 PM4/26/17
to Official Softimage Users Mailing List. https://groups.google.com/forum/#!forum/xsi_list
Yes, Volume VOPs I have been using a lot and seem the right way to go for the noise functions and simple range fit, clamps, gain, plus/minus/mul etc.

For anything point related which we would do in ICE previous sounds like all wrangles (minus the noise stuff you mentioned).

Andy Goehler

unread,
Apr 27, 2017, 12:28:03 AM4/27/17
to Official Softimage Users Mailing List. https://groups.google.com/forum/#!forum/xsi_list
Hi Steven,

same as Andy (Nicholas) here, VOPs mostly for Noise stuff, Wrangles for anything else.

Cheers and have fun.
Andy

Christopher Crouzet

unread,
Apr 27, 2017, 1:22:49 AM4/27/17
to Official Softimage Users Mailing List. https://groups.google.com/forum/#!forum/xsi_list
The `Unified Noise VOP`, which is a fairly useful node that outputs all the noise values in the [0, 1] range, takes pretty much all of its logic from the `pyro_noise.h` include file. Which means that you can easily have access to the same functionalities in VEX, like so:

#include <pyro_noise.h>
v@perlin = vnwrap_perlin3(v@P, 0, 0);
f@pflow = fnwrap_pflow1(v@P, {1, 2, 3}, 0);



The naming convention of these wrappers is detailed in the file. And in newer versions of Houdini than my H13, they have added a `unified_noise` function that makes it even easier to use.

Also, it's interesting to see how they managed to unify the noise values in `pyro_noise.h`: they basically ran a lot of samples and picked the min/max values of each noise to approximate their range. Statistics for the win! :)


@Steven To answer your initial question, you can use `pcimport(my_pc_handle, "point.number", my_ptnum_var);` to retrieve the point number.

The function `pcfilter` is handy only if you exactly want the behaviour as they documented it. If for example you'd like to use a slightly different weighting formula (based not only on distance but also on mass, for example), then you'd have to write your own.


------
Softimage Mailing List.
To unsubscribe, send a mail to softimage-request@listproc.autodesk.com with "unsubscribe" in the subject, and reply to confirm.



--

Olivier Jeannel

unread,
Apr 27, 2017, 1:33:45 AM4/27/17
to Official Softimage Users Mailing List. https://groups.google.com/forum/#!forum/xsi_list
Still in the VOP band wagon here :/

------
Softimage Mailing List.
To unsubscribe, send a mail to softimag...@listproc.autodesk.com with "unsubscribe" in the subject, and reply to confirm.



--

Christopher Crouzet

unread,
Apr 27, 2017, 2:03:34 AM4/27/17
to Official Softimage Users Mailing List. https://groups.google.com/forum/#!forum/xsi_list
Technically, VOP is just a wrapper around VEX, so you could say that you're kinda using VEX... indirectly! :P

@Steven I actually didn't reply to your question at all. I don't know how I manage to misread emails that well but I'm pretty good at it! Anyways, the function `pcfind` returns point numbers, so then you can just loop over them and use the usual methods, such as for example `point` to retrieve other attributes.

Olivier Jeannel

unread,
Apr 27, 2017, 2:46:23 AM4/27/17
to Official Softimage Users Mailing List. https://groups.google.com/forum/#!forum/xsi_list
:)

A question : What would be the exact equivalent of vex "primpoints" in VOP ? Primpoints returns an ordered integer ptnum array per primitive. 

Jonathan Moore

unread,
Apr 27, 2017, 2:55:00 AM4/27/17
to Official Softimage Users Mailing List. https://groups.google. com/forum/#!forum/xsi_list

Funnily enough it all get’s a bit ‘pop will eat itself’ in that a VEX Wrangle is in fact a digital asset and in that digital asset is a VOP and in the VOP is a VEX snippet node and that generates that actual VEX code!

As they used to say in one of my favourite 80’s US comedies ‘Soap’ - “Confused, you will be!”.  :)

Christopher Crouzet

unread,
Apr 27, 2017, 3:27:18 AM4/27/17
to Official Softimage Users Mailing List. https://groups.google.com/forum/#!forum/xsi_list
@Olivier: Not all VEX functions have been ported to VOP nodes, so maybe `primpoints` is one of these? Use a wrangle! ;)

@Jonathan: I guess the rationale is that there was no need write a brand new node only to repeat the same features already available elsewhere? Seems fair enough to me and it also follows Houdini's philosophy of putting together a few building blocks together to provide higher-level nodes.

Jonathan Moore

unread,
Apr 27, 2017, 3:54:02 AM4/27/17
to Official Softimage Users Mailing List. https://groups.google. com/forum/#!forum/xsi_list


No complaints from me Christopher. It just spun my head a little the first time I found out. Although now it makes complete sense even if it is all a little 'like a circle in a circle, like a wheel within a wheel’.  ;)

Christopher Crouzet

unread,
Apr 27, 2017, 4:06:25 AM4/27/17
to Official Softimage Users Mailing List. https://groups.google.com/forum/#!forum/xsi_list
I think remembering that I also had the same thought back when I started using Houdini but then it probably just sinked in... the logic in Houdini is strong! :)

Olivier Jeannel

unread,
Apr 27, 2017, 5:21:43 AM4/27/17
to Official Softimage Users Mailing List. https://groups.google.com/forum/#!forum/xsi_list
Thank's Christopher, I'm just realizing that now :/ 
i[]@toto  = primpoints(0, @ptnum); 
Won't work in a VOP Snippet, but I can bind the array in VOP later.

crazy, it's one of the most used function...

Andy Nicholas

unread,
Apr 27, 2017, 5:42:39 AM4/27/17
to Official Softimage Users Mailing List. https://groups.google.com/forum/#!forum/xsi_list
The `Unified Noise VOP`, which is a fairly useful node that outputs all the noise values in the [0, 1] range, takes pretty much all of its logic from the `pyro_noise.h` include file. Which means that you can easily have access to the same functionalities in VEX, like so:

#include <pyro_noise.h>
v@perlin = vnwrap_perlin3(v@P, 0, 0);
f@pflow = fnwrap_pflow1(v@P, {1, 2, 3}, 0);



Aah, thanks for that Chris. Didn't realise you could access the noise functions like that. Good to know :)


Also, it's interesting to see how they managed to unify the noise values in `pyro_noise.h`: they basically ran a lot of samples and picked the min/max values of each noise to approximate their range. Statistics for the win! :)

Yep, that's what I've been doing. I'm concentrating on FBM modes of evaluating the basic noise functions (noise(), xnoise(), snoise(), onoise(), anoise) as that's what I tend to use the most. Unified Noise is okay, but I still find problems with shifting offsets in the noise.

For example, make a grid with 150 divisions, create a Unified Noise in a Point VOP and set it to use Signature:->"3D Input, 3D noise", Noise Type->"Perlin", Fractal Type "Standard (fBm)" add the vector output to the point position and then try playing around with the Max Octaves, Lacunarity, and Roughness. You'll see that you get a global uniform "DC" offset along the each axis. That's not cool! If I'm using that as a noise force, then it has just pushed all my particles in the (1,1,1) direction. You'll also find that switching between noise types noticably changes the amplitude range. Again, not great if I'm doing lookdev and I just want to try a different noise type without changing the general magnitude force amount.

In addition to sampling the noise values, I'm doing some curve fitting to that data in Python's scipy which smooths out some of the statistical glitches with the sampling. It's giving some good results that don't exhibit the DC offset that I mentioned above. All this should let me create a replacement for the Anti-Aliased Noise VOP. I'm not dealing with the anti-aliasing aspect yet though, so it won't be as good for shaders, but the offset isn't quite so important in that context as it is for using it for forces.

Still need to do some testing and then package them up into VOPs, but once they're ready I'll release them in siLib for everyone to try.

A


Olivier Jeannel

unread,
Apr 27, 2017, 5:49:32 AM4/27/17
to Official Softimage Users Mailing List. https://groups.google.com/forum/#!forum/xsi_list
I found the Unified noise slower than the other noises. No ? 

Andy Nicholas

unread,
Apr 27, 2017, 6:08:54 AM4/27/17
to Official Softimage Users Mailing List. https://groups.google.com/forum/#!forum/xsi_list
Yep, Unified Noise is definitely very slow when tweaking the UI parameters. Haven't done any profiling yet though to see if that's due to recompiling issues vs actual performance of evaluation.
------
Softimage Mailing List.
To unsubscribe, send a mail to softimag...@listproc.autodesk.com with "unsubscribe" in the subject, and reply to confirm.

Christopher Crouzet

unread,
Apr 27, 2017, 6:09:23 AM4/27/17
to Official Softimage Users Mailing List. https://groups.google.com/forum/#!forum/xsi_list
Sorry, I can't really help as there are no `primpoints` function nor array attributes in H13, so I can't try any of that. That being said you are using @ptnum instead of @primnum.

Christopher Crouzet

unread,
Apr 27, 2017, 6:17:38 AM4/27/17
to Official Softimage Users Mailing List. https://groups.google.com/forum/#!forum/xsi_list
I've just tried what you said and in fact the unified noise doesn't even seem to use the full [0, 1] range as one would expect from reading the doc. At least not in H13. Or maybe I did something wrong. If this turns out to be true, it'd kill the primary purpose of the node to bring coherency between the different noise types. Not great for lookdev as you said.

This bring back blurry memories where I digged into the unified noise a couple of years ago and ended up coding my own, maybe because of this exact reason. But then I eventually lost the digital asset that I had built and ended up using the default noises instead :)


------
Softimage Mailing List.
To unsubscribe, send a mail to softimage-request@listproc.autodesk.com with "unsubscribe" in the subject, and reply to confirm.

Andy Nicholas

unread,
Apr 27, 2017, 6:22:17 AM4/27/17
to Official Softimage Users Mailing List. https://groups.google.com/forum/#!forum/xsi_list
Yes, exactly, I found the same. I'm quite relieved your experience mirrors mine as otherwise I've just been wasting a lot of my time! :)

Would love you to beta test when it's ready (if you're interested).
A
------
Softimage Mailing List.
To unsubscribe, send a mail to softimag...@listproc.autodesk.com with "unsubscribe" in the subject, and reply to confirm.

Olivier Jeannel

unread,
Apr 27, 2017, 6:22:34 AM4/27/17
to Official Softimage Users Mailing List. https://groups.google.com/forum/#!forum/xsi_list
Agree Christopher @primnum ;)

------
Softimage Mailing List.
To unsubscribe, send a mail to softimag...@listproc.autodesk.com with "unsubscribe" in the subject, and reply to confirm.



--

Christopher Crouzet

unread,
Apr 27, 2017, 6:34:38 AM4/27/17
to Official Softimage Users Mailing List. https://groups.google.com/forum/#!forum/xsi_list
Sure thing but be warned that I'm far from being a noise expert! :)


To unsubscribe, send a mail to softimag...@listproc.autodesk.com with "unsubscribe" in the subject, and reply to confirm.



--
Christopher Crouzet
https://christophercrouzet.com



------
Softimage Mailing List.
To unsubscribe, send a mail to softimage-request@listproc.autodesk.com with "unsubscribe" in the subject, and reply to confirm.


------
Softimage Mailing List.
To unsubscribe, send a mail to softimage-request@listproc.autodesk.com with "unsubscribe" in the subject, and reply to confirm.

Andy Nicholas

unread,
Apr 27, 2017, 6:40:10 AM4/27/17
to Official Softimage Users Mailing List. https://groups.google.com/forum/#!forum/xsi_list
Haha. Neither am I, I'd just be after some robust critical feedback :)

Steven Caron

unread,
Apr 27, 2017, 12:18:20 PM4/27/17
to Official Softimage Users Mailing List. https://groups.google.com/forum/#!forum/xsi_list
Well at first I was using VOPs. So the looping stuff was hard to get right. I eventually got it but it was hard to debug and get the result I was looking for. I obviously was just doing something wrong, I have little time right now to actually read ever doc/tutorial. I am relying mostly on my intuition with some docs/tutorials.

As we probably all know looping in a graph is a hard concept to visualize. ICE took most of it away with how it automatically looped over points and would do certain operations with arrays transparently, at the cost of making a simple loop not simple. VOPs has various loop blocks which is more general but I struggle with making sense of it (and most users I read don't use them). Fabric's Canvas (pre Blocks) had you write KL in your graph to do the loop/pex, and now with Blocks you have a better way of doing it with actual nodes but is still tricky to visualize.

Jason S

unread,
Apr 27, 2017, 7:10:02 PM4/27/17
to Official Softimage Users Mailing List. https://groups.google.com/forum/#!forum/xsi_list

    On 04/27/17 12:17, Steven Caron wrote:

    ... ICE took most of it away ... 

I would have to agree,  and add that in general, does ICE take most of it away.   (complication)

   
Reply all
Reply to author
Forward
0 new messages