Jump to content
probiner

How to input an attribute in an HDA parameter?

Recommended Posts

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

nsXN4eJ.png

should look like this with the random value point attribute.

X8TiYL9.png

 

 

AttribDriveParameter.hiplc

Edited by probiner

Share this post


Link to post
Share on other sites

I got some answers at sideFX forums and here I explain my questioning a bit more.
Basically: Is it possible to drive a single SOP float parameter with a geometry attribute? So far seems like the one way to go about it is to have an extra sting parameter to name the attribute... 

Cheers

cZZVJIx.png

Edited by probiner

Share this post


Link to post
Share on other sites

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.

or if I just need the variable:

float attrib = ch("attrib") ;

if( hasprimattrib(0, "hda_attrib")) attrib = prim(0, "hda_attrib", @primnum ) ;

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.

Cheers

Edited by probiner
  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×