From the course: Maya: Natural Environments

Binding an XGen preset description to polygons - Maya Tutorial

From the course: Maya: Natural Environments

Start my 1-month free trial

Binding an XGen preset description to polygons

- [Instructor] When developing and testing out XGen parameters, it's best to apply the XGen description to a small area of your mesh. You should avoid assigning XGen to a large area, such as the entire terrain object. It's very likely that the XGen output will be very heavy with millions of polygons, and interactivity will suffer. Changing parameters such as primitive size, color and distribution, is much faster and easier if we bind the description to a small area at first. Then when we're ready, we can append the remaining polygons to description binding, and for a camera-centric layout, as we'll see. That will only include the polygons that are visible to the camera. So let's start by selecting just a few polygons for testing purposes. I'll go into this camera view and select the terrain. Right click and go into face component mode, and just select a small area. We can go over to our perspective view. Right click in that view so we don't lose our selection, and then frame the selected polygons with the F key on the keyboard. So I've got nine polygons selected. Why don't I select a few more, just to give me a little bit larger area? Hold down Shift and select a few more, and now I've got 16 polygons selected. Now we're ready to open up the XGen Editor. That's going to be found in the Generate menu in the very top here, XGen Editor. We have three buttons here, Create New Description, Import Collection or Description, and Import Preset From Library. Create new description means to build a new set of XGen parameters from scratch. A description defines the properties of XGen geometry. Import collection or description means to load an existing description from disk, or you could load a collection, which is a convenient way to store multiple descriptions, especially if they're associated with one another and or are commonly applied to the same mesh surface. Collections are a required part of the XGen data structure and description is always stored inside a collection. Then the third button is Import Preset From Library. That's the one that we want. We can load in a grass preset. It'll be a jumping off point that then we can customize and make our own. Click Import Preset From Library. Then we see a library path listed here, and it's pointing to a folder in the Maya program directory. Select that path name, and then you'll see a list with images of all of the collections within that. So the one we want, it's called Grass2, and we can right click on it and choose Import Preset, or just double click on Grass2. Then we get another window, Import Preset. This will load a preset from disk, create a collection and a description in the current scene, and then bind the description to the current polygon selection. We need to give these things names, and I recommend including the string's description in the description name and collection in the collection name. That way, it'll be easy to identify what's what later on. So I'll call the description grass golden description, and I'll call the collection grass custom collection. And with those names entered in, we can go ahead and click the Import button, and then we can close the XGen library window. The XGen editor panel now turns into a full-blown editor with many tabs and lots of icons and menu items, and we see that our polygon selection has been populated with grass, and those are Spline primitives, as seen here in the Primitive Attributes section of the Primitives tab. Immediately after importing or creating a description or collection, save the Maya scene. That will create a collection file in the scenes folder of the current project. It's a best practice to go ahead and save that collection file out immediately, just in case Maya crashes or there's some issue. We'll take a look at the file and folder structure of XGen in the following movie.

Contents