Parametrising Hair Grooms with the strand based hair system

I am trying to implement hair for humanoid avatars in VR using Unity’s strand based hair system.
I created a simple groom in maya and followed this tutorial:

I plan to model different grooms and import them as alembic files, however i would like to allow for some parametrisation, e.g. it would be great to be able to adjust the length of the hair in unity.

I dont know a lot about curve modeling, but it seems like there are no native options in the hair components nor the alembic file importer. Is something like this possible, maybe using blendshapes or by somehow baking different lengths in an alembic animation (as i understand it, simulated animations is what this format was originally meant to do anyways)?

Hi dav_ege,

Just to clarify, would you want to ‘switch’ between each groom (change directly from one variation to the other), or interpolate between them (see the hair grow or shorten progressively)?

To interpolate, one thing to try would be to have two samples in your Alembic file, (1) the shortest variation and (2) the longest variation, and then animate the AlembicStreamPlayer time property to vary the length.

Let me know if that helps!

1 Like

The second is exactly what i meant. If i could smoothly interpolate between two styles/lengths like that, that would be perfect. I will try that out and report if it works. Thank you!

1 Like

So i tried this out. I modified the hair groom to be slightly longer in Blender by creating and animating a Shapekey. I then exported the groom as an alembic file and imported it into Unity. However, when i attach an AlembicStreamPlayer component to my hair object (which already has a hair instance component to actually display the hair) and manipulate the time property, nothing happened. I also tried reimporting the alembic file, just specifying specific frames, but again nothing happened. I am inexpierenced when it comes the strand based hair system, or the alembic file format, so i may just misunderstand the approach, could you elaborate on how you would achieve this?

Hi, thanks for trying it out! After looking into this, it looks like it might be a limitation on the Hair System side. I’ll investigate some more and get back to you if I find anything!

1 Like

Hi dav_ege, alembic groom assets cannot be modified at runtime without re-baking the whole thing every time there is a change. At the moment, it looks like you can only modify the length at runtime by using a procedural groom instead of an alembic groom.

1 Like

Hi rooose, thank you so much for looking into that! For my intended purposes though, changing the alembic grooms in the editor whilst not at runtime would actually suffice!
Do you think that is possible? I tried reimporting alembic files at different frames in their animation and rebuilding the hair asset, but nothing happened. I am wondering if i made a mistake when creating the alembic file or if that approach simply doesn’t work.

Hi dav_ege,
I think that would be possible, I will to make it work on my side to share steps on how to do it. I will get back to you once it works!

Hi again,

I managed to make it work in the Editor! Basically, on the Unity side, it should be pretty straightforward.

On the Maya side, I struggled a bit more to make it work. Here is what worked for me:

  • I used XGen to generate my groom
  • I worked from a collection preset that I converted to a XGen Interactive Groom. A non-interactive groom did not work. If you don’t have one, you can use ‘Generate > Convert to interactive groom’. If it is an option, you can also create an interactive groom directly.
  • I animated the scale property of my interactive groom rather than the length property of my initial collection
  • I used ‘Generate > Cache > Create New Cache’ to export my alembic cache rather than using Arnold to export (using Arnold did not work). I used the start/end setting and set it to my start and end frames.

I don’t have that much experience with Maya, so there is probably a better way to make this work, but this is what ended up working for me! Also if you need any more clarification, let me know :slight_smile: