Linear gradient to objects point attribute

   8469   4   1
User Avatar
Member
53 posts
Joined: July 2005
Offline
Hey guys.

I got a question.

After a few years break from houdini, I am having to relearn a lot of stuff..
One of the things I want to do is lets say I have an object of whatever shape..
I want to use a uv project from the YZ view, and apply a linear gradient to this.

I then want to use this gradient to apply it to an attribute to the surface/points.

The end idea is to use the gradient to drive the scale of copies that are stamped, but in a linear fashion. the gradient will be used for control within the final OTL.

How would I do this?

I imagine that I have to use vops, but if since its been soo long, and it seems like houdini has been re-arranged since I used it ( no longer divisions between sops, vops, chops, etc. I am still stumbling around Smile )

Any help will be appreciated ( btw, still on version 10 of houdini here…. will be getting v12.5 soon hopefully ).

( i moved this post from the learning houdini forum as it didnt pertain to any tutorials )

Attachments:
cloud_01.PNG (341.2 KB)

-m-k-
User Avatar
Member
4530 posts
Joined: Feb. 2012
Online
Hey ambient whisper, nice to see you here

Do you mean something like where your copies will have the smallest scale at YZ.min of your template geometry, and max scale at the YZ.max of your template geometry?

In this picture I did the same thing but only for the X axis and I added a small offset to all of them so nothing has 0 scale. If that's what you mean, it's easy to do the same for both axes by repeating the steps and multiplying both before you add an offset.

Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com]

youtube.com/@pragmaticvfx | patreon.com/animatrix | pragmaticvfx.gumroad.com
User Avatar
Member
53 posts
Joined: July 2005
Offline
Its good to be back
Yep. That is the idea.
I just need to use a gradient for this task because I want to expose the gradient to the user in the digital asset. imagine I have a variable gradient.
The only gradient I can find is inside of cop or vop, but the one inside vop is much nicer.
-m-k-
User Avatar
Member
4530 posts
Joined: Feb. 2012
Online
By gradient, you mean a ramp? I attached a file showing the same thing but with a ramp. I only did it for one axis, but the idea is the same. Let me know if this is not what you are looking for.

Another thing I assumed was that you needed to do this in the world space. If you want to do this in local space on an arbitrarily oriented geometry in space, it would be more involved if you don't know the orientation.

In that case, these operators would help:
https://www.orbolt.com/asset/animatrix::bestFitPlane::1.00 [orbolt.com]
https://www.orbolt.com/asset/animatrix::computeMinMax::1.00 [orbolt.com]

Attachments:
ramp_pscale.hip (112.5 KB)

Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com]

youtube.com/@pragmaticvfx | patreon.com/animatrix | pragmaticvfx.gumroad.com
User Avatar
Member
53 posts
Joined: July 2005
Offline
Hey, thanks a ton for the examples.

Yeah. possibly a ramp parameter because of its control ability. Its intuitive if exposed.

If its applied to uvs, then no matter where these clouds exist, they will get colour from their ramp parameter in uv space.

The other option I tried is to use an attribute transfer. This option works somewhat but it sucks because it gets it from another object, which I have to manipulate separately, and with less control of falloff.

Another question. Once I get these attributes, applied to the actual object, I know that they can be piped into a number of nodes for specific functionality that is already exposed, but how would I use an attribute as a weight map to drive the scale value Y within a transform node? Do I have to resort to Vops? The only way I have had it work is with a point sop. I have been having issues with getting it to work with vops and the transform node.

What would the expression look like within the transform node? Its not a simple $Cd ( plus some math ) expression. ( I hope its as simple as piping the attribute within an expression. )
-m-k-
  • Quick Links