Jump to content

How to input an attribute in an HDA parameter?


probiner

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
Link to comment
Share on other sites

  • 2 weeks later...

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
Link to comment
Share on other sites

  • 2 weeks later...

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
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...