Search - User list
Full Version: Transfer Guide ID to Hair
Root » Technical Discussion » Transfer Guide ID to Hair
mike.battcock
I need to get the id of the guide that the hair was created from. I've create a prim attribute called “guide_id” and added it to the Guide Attribute Transfer and Output Attributes on the hairgen node but the attribute is transferred across properly. I get the attribute on some hairs but only about 0.01%…. Same thing on sop level hairgen

Can someone tell me what i'm doing wrong or is this a bug?
eriksky
Hi,

I think the attribute transfer on hairgen only works with floats. What I do is to cast whatever integer attribute on the guides I want to transfer to hairs into a float using ‘attributeCast’ SOP. That will make the values transfer proper and the only thing left to do is to cast back again into an integrer ‘post-hairgen’. Is not very convenient but at least there is a workaround.

=e
mike.battcock
I did try that but the hairgen interpolates the values so if a hair is between two guides with IDs 1 and 100 the hairs will end up with a whole range of values between 1 and 100. But what I actually want is just to transfer the ID from the nearest guide (I.e. either 1 or 100).
I tried using xyzdist to get the nearest guide and promote to prims using “mode” which gives a decent result but still not perfect.
I might try a similar thing but only on the root point then transferring that along the rest of the curve
raptortrax
If you put a wrangle before the hairGen with

@clumpid = @primnum;

you can get clumpid out and then use attribute. I know you are not asking about clumping but the HairGen node has clump attributes that you can use to retain the info.

You can see it here at Hair and Grooming Talks at 34:40
https://www.youtube.com/watch?v=uZtKhMkbxkE [www.youtube.com]

His example is more geared to animation so I created a quick one from a project I was recently working on. See attached. Hope this helps.

Image Not Found
mike.battcock
I got a response from sidefx that this has been fixed in a later build:

This was fixed in Houdini 18.0.517:
Guide primitive attributes of data types other than float will now transfer
to hairs reliably. The value of the closest guide is used.


Too late for our job but good to know it will work in the future!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB