Scene file attached with a example case(Normal Displacement)where the problem is presented in 3 columns: left: Just HDA with single input value driving all points. center: Attempt to use a random value attribute @foo to drive each point. Failing. right: HDA exploded with @foo driving each point. Working as intended.
I inputing @foo and `point(0, “foo”, @ptnum)` in the HDA parameter but it didn't work.
So what's the best way to set up HDA parameters to also be driven by a per point attribute?
Thanks
should look like this with the random value point attribute.
This would let you specify an incoming point attribute to use; you could modify your HDA to allow the user to use a parameter value, an attribute, or even multiply them together.
Thanks for the hints guys. I wasn't aware about the Bindings! But both solutions seem to require duplication of parameters (one for single values, one to be name the attribute) and my mindset about this is more like what we do in VOPs, where we set an exposed parameter which can then be overridden by wiring something to it, so at SOP level I was expecting to do the same with an expression instead. Let me know if having 2 parameters per actual parameter is the only way to go about it. Thanks.
Ok, here's the how I went about it to avoid burdening the UI. In a wrangle inside the Asset I check if the attribute exists with the same name as the parameter in the UI, and if not I create it with the UI value:
float attrib = ch(“attrib”) ; // UI value variable from a spare input in the wrangle SOP.
if(! hasprimattrib(0, “hda_attrib”)) f@hda_attrib = attrib ; // If the attribute doesn't exist, it's created and the UI value assigned to it.
Might not be very pretty to create/rename/copy attributes before the HDA, but since they share the UI parameter name it's straight forward enough, while allowing neat extra control.