Storing a ramp as a per point attribute?

   803   1   0
User Avatar
Member
95 posts
Joined: Feb. 2020
Offline
We're all familiar with using Houdini's ramps UI to manipulate existing attributes, but what if we whished to store the "value" of a ramp parameter AS an attribute? I know there's a mathematical definition that describes a ramp curve (or just about any curve), but is there a simple way to access this representation from a ramp parameter and store it as an attribute, and then reference this curve in a vex wrangle?

Or would the best way to do this be storing the ramp parameter's path as a string, and then using chramp()?

If you're doing something like morphing the location of points in a mesh from one location to another, being able to do something like randomly assigning some percentage of the points to use a quadratic interpolation vs a linear interpolation would be useful!

Having a direct reference to a ramp parameter would be useful, so you could make adjustments to the ramp on the fly using houdini's competent ramp UI.


Edited by wyhinton1 - June 24, 2024 18:22:58
User Avatar
Member
9376 posts
Joined: July 2007
Offline
use Attribute From Parameters SOP to store ramp parameters as string, check Flatten Ramps

then you can evaluate those at any position using ramp_lookup() [www.sidefx.com]
or use ramp_unpack() [www.sidefx.com], ramp_pack() [www.sidefx.com] to alter or create that string in VEX
Tomas Slancik
CG Supervisor
Framestore, NY
  • Quick Links