How to input an attribute in an HDA parameter?

   244   4   1
User Avatar
Member
125 posts
Joined: June 2013
Online
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.

Edited by probiner - Dec. 28, 2017 19:56:05

Attachments:
AttribDriveParameter.hiplc (86.2 KB)

User Avatar
Member
2202 posts
Joined: Sept. 2007
Online
I think parameters can do that only via HDK (but I'd love to be proven wrong!), but you can use a string parm to pass in an attribute name:

vector norm = point(1, "N", @ptnum) ;
@P += norm * point(0, chs("myattr"), @ptnum);

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.

Hope that helps!
I'm o.d.d.
User Avatar
Member
2860 posts
Joined: July 2007
Offline
just use Bindings tab on wrangle to bind your specified attrib to any VEX @ variable name
that way you don't need to use any code insertions

Attachments:
AttribDriveParameter_fix.hiplc (82.8 KB)

Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
125 posts
Joined: June 2013
Online
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.

[streamable.com]
Edited by probiner - Jan. 8, 2018 06:45:00
User Avatar
Member
125 posts
Joined: June 2013
Online
Well then two/tree parameters per parameter it is then…

1 - Slider
2 - Attribute name
3 - How they are mixed

I wouldn't mind just a replacement like one connects something to a VOP nodes but with vex import functions…
Edited by probiner - Jan. 12, 2018 17:35:35
  • Quick Links