XGen Hair Growth

XGen Hair Growth

hinobayashi
Enthusiast Enthusiast
3,896 Views
7 Replies
Message 1 of 8

XGen Hair Growth

hinobayashi
Enthusiast
Enthusiast

Hi everyone,

 

I made a ponytail in xgen with splines and want to animate the growth and noise of it.

I tried animating the primitives directly and through a Lattice deformer but neither worked.

Is there another easy solution? I don't need a physical correct hair system.

 

Best regards.

0 Likes
Accepted solutions (1)
3,897 Views
7 Replies
Replies (7)
Message 2 of 8

sean.heasley
Alumni
Alumni

Hi @hinobayashi

 

A former Autodesk employee @Michael_Todd gave a solid breakdown on this in this thread!

 

From that thread:

 

Whilst you can right click and key frame length values on the groom splines Length setting, it won't work as expected  as the length value is stored as a ptex map and you can't export per frame ptex maps.

 

The best way to animate the length value is to animate the Length Parameter in the primitives section. You can right click over the length name:

 

LinkToAttr.png

 

and link the parameter to a Maya attribute, in this case a float value.

 

This adds a Patch attribute to the geo that xgen is bound to:

 

$length0= patchAttr("xgen_LengthAnim_length_length0");#0.0,1.0

$length0

 

This attribute can be key framed by right clicking over the parameter:

 

Setkey.png

 

With this expression:

 

$a=map('${DESC}/groom/length/');

$length0= patchAttr("xgen_LengthAnim_length_length0");#0.0,1.0

$length0*$a

 

You can then use the key framed values as a multiplier on the groom splines control map for length. The groom splines length will not cahnge, but the renderable XGen splines length values will alter according to the set values

 

LengthA.png

 

LengthB.png

 

The Patch attribute on the geo can also be linked to other Maya node outputs, such as locators scale, so you could drive the length value with a locator in the scene if you wanted:

 

LocatorScale.png

 

ScaleA.png

 

ScaleB.png

 

 

Cheers

 

 

 

If one or more of these posts helped answer your question, please click Accept as Solution on the posts that helped you so others in the community can find them easily.

 

 

 

Kudos are greatly appreciated. Everyone likes a thumbs up!

 

 

Message 3 of 8

hinobayashi
Enthusiast
Enthusiast

Hi Sean!
Thank you very much for your reply.

Changing and keying the length parameter indeed works pretty well.

Now, is there a way I can animate the primitives, for example if I want to move the ponytail over the character's shoulder?

I saw that you can do it with a guide modifier on groomable splines which doesn't seem to exist for splines.

0 Likes
Message 4 of 8

sean.heasley
Alumni
Alumni

Hi @hinobayashi

 

It could be done via modifiers or animwires depending on which version of Xgen you are using and/or how you are working.

 

This is one way with animwires:

 

And this is a way via modifiers/linear wires:

 

 

0 Likes
Message 5 of 8

hinobayashi
Enthusiast
Enthusiast

Thanks again for your reply.

The tutorials are great but not exactly what I'm looking for.

In my animation I have a doll with ponytail which will grow longer over time and will move over the doll's shoulder. 

The head won't move and therefore the animation is not realistic so I don't need a hair system.

The modifier tutorial is more like I want to have it but it only seems to be working with growable splines. Setting up my ponytail with growable splines would be a bit complicated....

Is there really no easy way to take my hair primitives and animate them with 3 keys?

Maybe with a deformer?

0 Likes
Message 6 of 8

sean.heasley
Alumni
Alumni

Hi @hinobayashi

 

How do you have the hair set up currently? Just via splines with classic Xgen?

 

When you get a chance, can you please zip and attach the scene file here or via dropbox/google drive or another file sharing program so I can take a look at it? If the file is confidential or under NDA please send it to me in a private message instead of posting it here.

 

 

0 Likes
Message 7 of 8

sean.heasley
Alumni
Alumni
Accepted solution

Hi @hinobayashi

 

Thanks for sending me the files! Looking at your file one thing to note for future reference is that I believe IGS would make this process much easier for you if you ever do a similar project.

 

As for your set up currently, one thing you could is duplicate the head, hide the old head and then move the hair forwards via keying the polygon it's connected to. So the hidden head will be moving which will cause the hair to move so it will only look like the hair itself is moving.

 

If that doesn't help, you could also try rotating the attached polygon for the hair to sort of thrust the hairs forward over the shoulder. That combined with increasing the length modifier could work well enough.

 

 

Message 8 of 8

hinobayashi
Enthusiast
Enthusiast

Hi Sean,

 

thank you for looking at my scene.

Ok, I will try the duplicate method tomorrow and if it doesn't work at all, I'll try the Interactive Grooming.

 

Again, thank you very much!!!