Project 6d: XGen

Goal Learn the basics of XGen.

Simulations aren't only for helping us with animation and object movement. We can also use effects systems to simulate lots of repeated elements, such as hair, grass, fur, or vegetation. We're going to use a fairly new system in Maya called XGen to simulate two simple effects.

  1. To start off, create a sphere and scale it up so that it is a reasonable size. Unfortunately, XGen is not in the FX Menu set, but rather is in the modeling menu set, so switch over to that now. If you don't have a Generate shelf, you may need to load the xgenToolkit.mll plugin using the Plugin Manager, located at Windows → Settings/Preferences → Plug-in Manager..

    A brief side note on renderers: If you don't have the Arnold plugin loaded before you move onto the next step of this assignment (creating a Description), the Description you create will never be able to be rendered using Arnold (which we don't want!) Even if you re-enable Arnold after you create the description, it still cannot be rendered. Now, Arnold should be enabled by default on the lab machines, but it's still good to check by going to the Windows → Settings/Preferences → Plug-in Manager. and enabling the mtoa.mll plugin (near the bottom of the list) by clicking the Loaded checkbox next to it and then clicking Refresh.

    Instances of an effect in XGen (like, different types of hair or fur or plants) are called "Descriptions". Making one from scratch is pretty tough, so we're going to start with a preset, like we did with nCloth. To assign a preset description to your sphere, first select your sphere, then go to Generate → XGen Library. This will bring up a new window.

    Click on C:/Program Files/Autodesk/Maya2017/plug-ins/xgen/presets/library under the Library path, and it will show you a list of different types of preset descriptions you can start from. Scroll down to the bottom, click on Wet_otter, and double click on the icon. This will bring up another new window, with settings for the new description you're creating based on the preset. Change the description name to something that makes sense, like otter_fur_description, and make sure you have "Create new Collection" checked. Enter in a sensible new collection name here too, like fur_collection. Hit import, and wait a second as it runs its calculations and generates the effect.

    Now we have our furry sphere! (If it is displaying as red or weird looking, make sure you're in Viewport 2.0.) We can see a new node has been created in our outliner that has the name of our collection, and inside it is our fur description. It looks a little sparse and gross at the moment, though. We can adjust the settings of our description by clicking on our descriptiuon in the outliner, then going to Generate → XGen Editor.. This will pop up a new window on the right side of our screen that looks very similar to our normal Attribute Editor, but specifically for XGen. Try playing around with the settings; more information on what they do can be found on the autodesk website (there's a link in the resources section of this document).

    At the very least, adjust the Length, Width, and Density sliders so that the fur is less scraggly. You may also find that adding a material to the underlying sphere, or hiding it, helps the look. When you're happy with your fur, render out a frame of the ball to turn in. Rendering may take a while, as it's calulating a lot of points in the simulation, so go get a cup of your favorite beverage while it does its thing.

  2. The next part of our assignment will be about creating your own description, specifically for generating foliage. Hide your sphere and fur description in your outliner. Now, create a plane and scale it so that it is fairly large. Just like nCloth, bump up the number of subdivisions to about 20. If you'd like to sculpt it to give it some shape (like it's a rolling hill of some kind) then go right ahead! Simple shapes of terrain will work better.

    Now, instead of using a preset description from the Library, we're going to create our own. First select our terrain plane geometry, then go to Description → Create Description... This will bring up a new window. We're going to want to name the new description alien_grass, and put it into a new collection called grass_collection. Then we want to select that they are Splines, generated randomly across the surface, and using attributes controlled by expressions.

    This covers our plane in randomly distributed orange hairs. Like in the first part of this assignment, you may find it helps the aesthetic to have a material on the ground. Adjust the length and width so that they look more like tall strands of grass, and decrease the density so that they're relatively spread out.

    Let's change the shape of these guys a bit. Using the Width Ramp in the Primitive Attributes section of the XGen Editor for the description, we can adjust the cross-section for our splines. Make any kind of weird shape you like! For the second, self-driven part of the effects project, feel free to look at how you can change the polygon primitive types to represent things like trees, bushes, or flowers - bur for right now we'll stick to weird alien grass.

    For a final touch, let's change the material that's being applied to each of our blades of grass. To do this, all we need to do is click on our description (alien_grass) in our outliner, and just like any other object, assign it a new material in the viewport. Try out different types of shaders, or a file texture, and see what happens!

    Once you're happy with your alien grass landscape, render out a frame of the scene to turn in. (Depending on how many blades of grass you have, it may take quite a while to render, so you may want to reduce it.)

  3. Turn In You will be graded on the following:
    • Following instructions
    • Your effects being different from the default effects
    Turn the following into Collect-It on Catalyst:
    • A rendered image of your furry sphere and your plants:
    • [lastname]_[firstname]_plants.jpg