Jump to content

Transform according to Attribute Paint


teshelman

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!

AttributePaint.PNG

Link to comment
Share on other sites

Hey,

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. ^_^

image.thumb.png.251e0752f055042f7bd4e61915095263.png

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...