Expose Curve length on hda

   1857   8   0
User Avatar
Member
35 posts
Joined: Feb. 2017
Offline
Hello

I'm trying to find a way to expose the length of a curve in hda.
I'm using Measure node to measure Perimeter from Primitives, and attribpromot to send it to detail.

But I'm stuck when I want to expose the perimeter float value, just ‘for information for the final hda user’.

Can you explain to me how to do it, please?
Edited by innocent - June 16, 2020 11:18:43
User Avatar
Member
2042 posts
Joined: Sept. 2015
Offline
Inside the hda you could create a spare parameter and use a detail expression to get that value….then promote the paramter to the asset level.
User Avatar
Member
35 posts
Joined: Feb. 2017
Offline
Yes, I agree with you but I don't know how to do it.

My perimeter value = 46.18
on an attwrangle, when I test to store @f = detail(1, ‘perimeter’); that gives me 0.

I miss something…

@f = @perimeter;
how to store or target this on a spare parameter ?

I find :
expression on spare param : detail(“../attribpromote2”,“perimeter”, 0)
Edited by innocent - June 16, 2020 13:13:20
User Avatar
Member
35 posts
Joined: Feb. 2017
Offline
is there a way to promote on the hda interface a parameter value as read-only ?
User Avatar
Member
2042 posts
Joined: Sept. 2015
Offline
You could do it the opposite way for that.

Instead of dragging and dropping the parameter that has your perimiter value.

Create a spare parameter through type properties of the asset.

Then Save Node Type and Match Current Definition.

Now drag and drop the parameter inside the asset that has the perimeter value into the new spare parameter of the asset to create a relative reference (now don't do the drag and drop type of operation one normaly does for an asset creation). Your dragging and dropping on the asset node itself not the asset interface.

Once you've done that click the assets cog icon and save preset.
User Avatar
Member
8597 posts
Joined: July 2007
Offline
to have it being a part of HDA rather than a preset you can put your expression as a default value in Type Properties for your parameter
then also you can disable it bu having hidden parameter set to 1 and your length parameter have disable when conditional
or it's also common to create LAbel parameter and put the `detail()` expression in there which will pull the value from the geo

on the flip side having UI values depend on cooking geo can drastically slow down the interactivity and may be causing unnecessary recooks even if the geo is supposed to be still cached, not sure if this is still happening, but was an issue in the past
Edited by tamte - June 16, 2020 16:38:57
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
2042 posts
Joined: Sept. 2015
Offline
“to have it being a part of HDA rather than a preset you can put your expression as a default value in Type Properties for your parameter”

Such a better solution…rhetorical question - why didn't I think you could put an expression rather than just a numerical value for default.
User Avatar
Member
35 posts
Joined: Feb. 2017
Offline
thanks for your help.
User Avatar
Member
35 posts
Joined: Feb. 2017
Offline
It works well for a curve made in Houdini.
I'm using an operator path to input a curve made in Unity, is it possible to measure his length?
  • Quick Links