Search - User list
Full Version: Getting point values in Group by Expression node
Root » Houdini Indie and Apprentice » Getting point values in Group by Expression node
windzerg
Hi All!

Recently I've been following this tutorial [www.pluralsight.com] about insects locomotion - I'm sure lots of you know this one- and unfortunately it was based in Houdini 11 environment So I have to research and make it work in Houdini 18, it's been quite a thrill ride. Here's the latest problem I encountered.

The input is a list of 240 points, with a attribute called “step”. The numbers in this attribute make sudden jumps like steps: first few points' “step” numbers are 1, and then a few are 2, and then 3, etc. See a screenshot of the spreadsheet below.



The tutorial guy then made a Group by Expression node, he wanted to find out the points that are about to jump in “step” attribute (for example, the point's “step” storing the last “2” before jumping to “3”). So he wrote this in the expression:

point(“../in”, $PT, “step”, 0) < point(“../in”, $PT-1, “step”, 0)

It selected the ones that about to jump, but ignored the points which has the same “step” attribute next to it.



I did some search on how expression changed in the past versions and did the following but couldn't make it work:

point(“../in”, “step”, @ptnum) < point(“../in”, “step”, @ptnum-1)

@step < @step-1 (this one will just select all points)

May I ask what would be the equiveloent in houdini 18?


Attached are few screenshots and the source file. The group by expression node is in the geo “prep_motion”
vusta
I'm lost in your noodle graph…but is this what you're after ?

@step < point(0,"step",@ptnum-1)
so basically $PT -> @ptnum
he's trying to compare the step attrib of current point to step atrrib of previous point

(i just reread your attempt and for current point, you just say @step instead of needing to use point() on it).

copied some box onto the selected points for viewing purposes, while before, there were none….think it's right:/
windzerg
vusta
I'm lost in your noodle graph…but is this what you're after ?

@step < point(0,"step",@ptnum-1)
so basically $PT -> @ptnum
he's trying to compare the step attrib of current point to step atrrib of previous point

(i just reread your attempt and for current point, you just say @step instead of needing to use point() on it).

copied some box onto the selected points for viewing purposes, while before, there were none….think it's right:/


It works! wow. I feel like I lack a fundamental knowledge on the rules of writing expression. May I ask why getting the “step” value of @ptnum-1 it needs to write point(….), but for the value of @ptnum, you just need to use @step?

Thanks!
vusta
i hope an expert or dev jumps in answer you, coz most likely i'd say the wrong/confusing thing…but i'll try:

you're selecting items based on their attrib, say, @P.y > 0.5 so as you go thru each point or prim to test for qualifications you already have access to their attribs handy so you don't have to say go get me the attrib, using point(), then test it.

technically, i don't see anything wrong with doing it, just inefficient…but why it doesn't like it requires explaination from the devs methinks.

(for previous point, to get access to its attrib, you need to go get it using point() coz you are currently NOT at the previous point)
windzerg
Got it! I think it's clear enough. If referencing a value that's not where I'm currently at, a formal expression point() is needed.

Thanks again for the great help!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB