Jump to content

Transform according to Attribute Paint

Recommended Posts

I'm trying to move points on a grid, with the transform affecting the points according to the values stored per point in a "mask" attribute defined by an Attribute Paint node.  As in, on the grid in the attached image, I'd like the points in red (1.0 "mask" value) to move the full value of a subsequent Transform node, points in purple (0 "mask" value) to not move at all, and points in between to move based on their own "mask" value.  Say, a point with 0.4 "mask" would move (0.4*Transform).  To me, this seems like a simple request/operation, but I can't sort out how to actually make Houdini do it.  I've tried a subsequent Transform node but couldn't sort out how to make it apply selectively per point, modified by the "mask" value.  I can make a group that is limited to points with nonzero values and move that, but that's a boolean sort of selection, and I can't use the "mask" values to modulate the effect the Transform has for a nice falloff.

I then tried a For Each loop that applied to each point, and was able to get each point to move with a simple Transform within the loop, so I can use that to nudge around *all* the points the same distance, but I can't get it to use the "mask" value, and I'm not sure how to get the For Each loop to only look at the points that have non-zero values (understanding that multiplying by a zero "mask" value would give no translation as desired, but sometimes it's nice to not have the cooking process even look at those to start with).  I tried "10*@mask" and "10*P.mask" in the within-the-For-Each-Loop-Transform's translate channels to try to use the "mask" value, but those didn't work.

I *know* I'm missing something obvious, as I'm still learning all of this, but is there a simple solution to this sort of thing?  It seems like a simple request, but I can't find hide nor hair of a clean, easy way to handle this, and a complex solution is out of my understanding to date.  Thank you!


Share this post

Link to post
Share on other sites


I hope I understood what you're trying to do, I believe you're trying to control the position of your points based on the mask value. If so, you can just add a point wrangle and using if statement you're ignoring the 0-mask valued points (purple) and only applying the condition on the rest, then simply add the mask value to the Y position of the masked points. Multiple it by a channel float if you would like to control the height/distance. ^_^


Share this post

Link to post
Share on other sites


Thank you, that's exactly what I was looking for, yes.  Your help is much appreciated!  I knew it had to be something straightforward, I'm just not well versed with VEX.




  • Like 1

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