I’ve spent the past few months learning how to create realistic-looking hair in Maya. Like so many things in Maya, I found that there were several different ways of achieving a single goal, each with their own advantages, disadvantages, and bugs. It took me a long while to figure out the pros and cons of each, and at the time I was starting, I couldn’t find an overview of the different options available. So, here’s the primer I wish I’d had, for anyone else in the same situation.
I’ve found four different ways to create hair in Maya:
- XGen with Guides (use guides to define the overall shape of a hairstyle, then apply styling modifiers on top to add the detail)
- XGen with Groomable Splines (comb and style hairs using a selection of grooming tools to create a style)
- XGen Interactive Grooming (a newer take on the grooming approach, which lets you use guides for the overall style, and then apply modifiers and use interactive grooming tools to refine the style)
- nHair (Maya’s hair dynamics system)
(Maya also had an older hair generation system, now known as Classic Hair, which is deprecated, and so isn’t covered here.)
You’ll note that three of these four options have “XGen” at the start of their name. XGen (or more formally, XGen Geometry Instancer) is Maya’s procedural generation system for covering surfaces with hair, fur, grass, plants, forests, and more – basically, anything that needs lots of instances of similar things positioned over a mesh’s surface. Confusingly, it offers three different (and essentially separate) ways to create hairstyles – two of which have “groom” in their name – all which is kinda confusing, and can make it hard to determine which of the three systems Autodesk’s documentation is referring to.
Because these four systems are essentially separate, and have different strengths and weaknesses, it’s important to choose the right one before you start creating a hairstyle. (Building a realistic hairstyle is a slow process.) Let’s take a look at what each system is good (and not so good) at doing.
XGen with Guides
Perhaps XGen’s biggest advantage for hair styling is that you can define the overall shape of a hairstyle (or anything else you want to generate procedurally) by placing guides on a model’s surface. These guides are like “master” hairs, defining the curve shapes for surrounding hairs to follow. You typically place lots of guides all over the surface you want to be covered, and then XGen generates hairs to cover that surface, based on the location and shape of the guides. The generated hairs take on the average shape of guides near to them (interpolating between multiple guide curve shapes), making it easy to define the overall outline of your hairstyle (or eyebrows, or eyelashes, or whatever) without needing to sculpt the exact shape of every single hair.
Once you’ve set up a hairstyle’s guides, you can then add modifiers that affect the generated hairs to tweak their curves, adding things such as clumping (which mimics the natural tendency of hair to form clumps with other nearby hairs) and noise (which breaks up a hairstyle to make it look more natural / less perfect). The end results can be remarkably realistic – XGen-with-guides is often used by professional groomers (yes, that’s really a 3D industry job title) to create hairstyles (or grooms) for virtual recreations of humans in movies.
In addition to guides, XGen has several more powerful features:
- You can paint texture maps on your model’s surface to vary things like hair density, width, and length – useful for defining hairlines and bald spots, and varying the generated hairs at different points on the surface
- Alternatively, you can define mathematical expressions to define values for any of the parameters
- You can set a stray hair percentage for each groom, to mark a certain percentage of hairs as “stray”. You can then use this “stray” marker to apply more noise to just the stray hairs in your groom, to make them look like the “flyaway” hairs you’d find in a natural hairstyle.
- You can mirror guides across an axis to save yourself time when shaping your groom – for example, by defining the guides for one eyebrow, or for one half of a bob haircut, and then mirroring these guides to the other side of the head
- You can edit the individual curve points in a guide, giving you fine control over the exact shape of the guide in the same way as for editing NURBS curves
- You can style your guides using the sculpt guides tool to modify the curve and shape of the guides in 3D space
- There’s a dedicated XGen Editor, which is a custom properties editor for XGen-related things
- You also get lots of handy utilities for importing / exporting / modifying / verifying guides, curves, and other groom-related things
The biggest downside to XGen is that you can’t style or sculpt the individual hairs once they’ve been generated (and modifed by the modifiers) to add a final detail pass. You can remove individual hairs – kind of like plucking eyebrows – but you can’t style them. So, while you have a lot of tools available to create great-looking grooms, there’s no way to add that final level of detail by tweaking individual hairs to sit exactly where you want them. (More on that in the XGen Interactive Grooming section below.)
A few other downsides to XGen’s guide-based system:
- All of your groom’s clumping modifiers have to be applied before any other modifiers (e.g noise), which can limit your styling options slightly (but not disastrously)
- XGen saves some of its groom information in a text file that lives alongside your main Maya project file, and yet more groom information in a separate “xgen” folder at the root of the current Maya project. This is is really annoying, and seems entirely unnecessary given that everything else that defines your scene’s data lives in a single scene file (.ma or .mb file).
- XGen is based on the concept of collections of descriptions (where each description is part or all of a groom, and multiple grooms can be in the same collection) – but the names of collections and descriptions have to be unique across your entire Maya project folder (not just within a scene file), because they are represented by a folder on disk, which gives even more scope for grief when renaming
- Because of its multi-file approach, XGen is very sensitive to changes you make to the names of meshes in your groom. Renaming things can be fraught with danger and unexpected consequences, and can be the source of lots of grief
- [Any more?]
Despite these downsides, XGen’s guides-based approach is extremely powerful for creating realistic hair grooms. Once you learn its idiosyncrasies, it’s a very effective system.
XGen with Groomable Splines
XGen’s groomable splines system is built on the same collections-and-descriptions engine and interface as XGen with Guides, but instead of placing guides to decide the shapes of hairs, you start with a bunch of hairs sticking straight out from the surface of your model, and use various grooming brushes to groom those hairs (or splines) into the style you want. It’s primarily designed for grooming short hair such as a beard, or other short growths like grass or fur.
Unfortunately, the lack of guides makes it very hard to create good-looking longer-hair grooms via this approach. The problem is, creating a hairstyle from scratch is a very difficult task. Think of all the work your hairstylist has to do (in the actual 3D world) to hold or clips bits of your hair out of the way while cutting and combing other bits, and then imagine that you have to do all of that via a 2D interface, while also applying the equivalent effects of any hairspray or product to keep the hair in a certain shape, all as part of a single task. It’s basically impossible to get this to look good with grooming tools alone. Add to this the fact that the Groomable Splines tools aren’t interactive – you don’t get to see the effect of a brush until after you’ve applied it to a surface – and it becomes even harder to make hair look good. It’s like asking your hairstylist to close their eyes every time they approach your head, and then open them when they’re done cutting to see if they got the result they expected. (Although to be fair to Maya, your hairstylist doesn’t have an undo feature.)
It’s telling that every single (good-looking) groom example or tutorial I’ve found on the Internet has used guides to provide the overall shape of the groom, and then built on top of that shape to tweak and modify the hair to add detail. (This is true even for shorter, simpler grooms such as eyelashes.) And from my own experience, a guides-based grooming system is just so much easier and more predictable to work with.
So, my recommendation would be: while it can be useful for short, regular coverings such as grass or fur, if you’re creating realistic hair, give Groomable Splines a miss, and use XGen with Guides or XGen Interactive Grooming instead.
XGen Interactive Grooming
XGen Interactive Grooming is a new and self-contained feature bundled alongside the original XGen, which gives you a much more (yes) interactive way to create hairstyles and grooms. It adopts many of the same features as the XGen-with-Guides approach – it has guides, modifiers, maps, and expressions – and combines them with interactive versions of tools like the ones from XGen Groomable Splines. Don’t be fooled into thinking that Interactive Grooming is part of the original “core” XGen, however – it really is a completely stand-alone system (with its own separate XGen Interactive Groom Editor) that just happens to look a lot like the original XGen. (This confused the heck out of me at first, and can make Autodesk’s documentation confusing to navigate until you know how to differentiate the two.)
Interactive Grooming (or “IG”)’s best feature is its sculpt modifiers and layers, which allow you to interactively sculpt individual hairs using interactive grooming tools such as grab, comb, and pinch. A single groom can contain multiple sculpt modifiers, and you can layer them with other modifiers such as clumping and noise to create highly detailed grooms, adjusting the weight of each modifier to get just the effect you want.
Sounds like the best of both worlds, right? Well, here’s the problem. I expected to describe IG as “like old XGen system, but with the missing ‘tweak the hairs’ bit added on top”, and from everything I’ve read on the Autodesk site, that’s certainly its marketing positioning. Unfortunately, there are a few classic XGen features that didn’t make it into Interactive Grooming – or at least, haven’t made it in yet – that (for me) severely limit IG as a system. (It’s also very confusing to get your head around, but TBH that’s true of everything XGen-based.)
For me, the killer missing features are:
- You can’t edit the CV points of guides (to edit them like curves), which is particularly annoying when working on longer hair styles where guide shaping precision is important
- You can’t mirror guides from one side of a body to another (something I use all the time in the XGen-with-Guides approach)
Both of these limitations can be worked around by converting guides to NURBS curves, performing the desired actions on the curves, and converting the curves back into guides, but it’s an annoying and laborious process (and curves, unlike guides, aren’t locked to the surface of a mesh). For me, it’s been reason enough to stick with “classic” XGen’s superior guide system, although I would happily switch over to IG if these features were added.
There are a few more upsides, however:
- Clumping modifiers can go anywhere in the modifier stack
- The groom data is stored in the main Maya project file, not in random text files dotted around the project folder (yay!)
- In my experience, IG grooms are faster to generate and work with in the Maya viewport
…and a few more downsides:
- The density and width tools aren’t applied on sculpt layers – they are applied to the base mesh instead, and it’s not obvious how to undo their effect
- There’s no stray percentage feature in IG – you have to define any stray hairs yourself, which is fiddly and imprecise
- Working with guides in IG is more complex than in “classic” XGen – in IG, the guides are “hairs” in their own mini-groom that lives as the child of a guides modifier on the main groom, which takes a bit of getting used to
The hybrid approach
There are a few ways to get the best of both worlds, however. XGen has an option to convert a classic XGen groom into an Interactive Grooming groom. It’s a one-way process – the output is a set of generated hairs, with all of the classic XGen groom’s guide curves and modifiers applied to them and baked into their shapes. In other words, the guides and modifiers from the classic XGen groom aren’t converted to IG guides and modifiers – rather, their effects are baked into a set of output hairs, which then become a “base” Interactive Groom for you to style further if you wish.
One way to use this conversion process is to get your classic XGen-with-Guides groom looking as good as possible, and then bake-convert it into an Interactive Groom and add the finishing touches by sculpting any individual hairs that aren’t quite where you want them to be.
Another approach is to complete the finished hairstyle as a classic XGen-with-Guides groom, and then convert it to IG to make it easier (and faster) to use and store in a Maya project file without all those extra text files hanging around. (Just be sure to keep the classic XGen-with-Guides groom filed away somewhere, so you can go back and modify the un-baked version if needed).
There’s a third way to combine the old and new XGen systems to get the best of both worlds, and it’s something I’m trying in a new groom as we speak. In this approach, you use classic XGen’s guide editing tools to get the overall base shape of the groom the way you want it; then, you convert those guides to NURBS curves, and use the NURBS curves to create the guides for a new IG groom (rather than a converted one) in which you add modifiers and sculpting layers to provide the groom’s realism. I’ll write this up as a separate article if the process works out for me.
nHair
nHair is another Maya system for generating hair across a surface. Unlike XGen, nHair is primarily designed for animating and modifying the generated hair in a real-world physics / dynamics simulation. Although you can use it to style hair, it’s not really the tool to use for creating a realistic-looking hairstyle. Nonetheless, let’s take a slightly more detailed look at how it differs from the XGen approaches described above.
nHair works on the principle of follicles, which are points on the surface of a mesh that emit a clump of hairs, together with a start curve that defines the shape of those hairs at the start of a dynamic hair simulation. While this might sound a bit like the XGen guides approach described above, nHair doesn’t have any guide-specific tools to edit these start curves (other than the standard Maya NURBs curve editing tools). It also doesn’t have modifiers for clumping / noise, and doesn’t provide any way to style or tweak the individual hairs. It’s really intended as a hair simulation system, not a hair styling system.
In addition to defining start curves that shape its hairs, an nHair system also defines the physical properties of the hairs – how much they stretch, bend, weigh, and so on – so that they can take part in a dynamics simulation over time. This dynamics simulation is part of the wider Maya nDynamics system, which also includes cloth simulation (nCloth), particle simulation (nParticles), and other dynamic simulations. This means that hairs in the nHair system can collide with other objects (meshes, nCloths, etc.) and respond to them in a physically accurate manner.
Although nHair isn’t particularly useful for creating a hair style, it can be used to add a hair dynamics simulation to an XGen-with-Guides groom, or an XGen Interactive Guides groom. A description of how to do so is an article in itself, but here’s the quick version: you make the XGen guides behave as hairs in an nHair dynamics system. In other words, you style your XGen guides to provide the starting state for an XGen hairstyle, and then you make the guides dynamic (or at least, driven by dynamics) so that the guides respond to the physics and gravity of an nHair simulation. That way, when the XGen guides change shape because of the effects of physics over time, the hairs they shape in the XGen groom also change shape in response to physics.
Summary
In summary, as of Maya 2019, my personal recommendation would be to learn the classic XGen with Guides approach if you’re creating a complex hairstyle, and to consider XGen Interactive Grooming as a way to add polish to your groom if needed at the end of the grooming process. My hope is that one of these days Interactive Grooming will get a bit more polish of its own, and might even gain some of the more useful guide-editing features from the classic XGen approach.
Postscript
As with so many things in Maya, the best way to get started is to follow tutorials by people who really know what they are doing. I personally signed up for Tarkan Sarim’s Patreon ($25/month), which contains lots of useful, detailed walkthrough videos from a professional 3D groom creator. Tarkan has a few videos about XGen Interactive Grooming, but mostly he covers the classic XGen with Guides workflow, and his videos are very informative.
If you’ve found this article useful, please do let me know! I’m still learning Maya, and I’m happy to share what I learn as I go if it helps other people get up to speed faster. Comments, suggestions, and corrections are gratefully appreciated 😀