Basic Asset Setup and Export out of Maya

Overview

This tutorial will explain on how to setup assets and export them out of Maya into the CRYENGINE using the Crytools that are available.

Before getting started, you should familiarize yourself with the Installing the Maya Tools and CRYENGINE User Interface in Maya articles.

Getting Started

After having finished modeling and texturing our geometry and assigned our shaders, proxy geometry are needed for collision detection. Right now the proxy geometry has just a standard Lambert assigned. On top of that we have also created LODs (LOD1 and LOD2), those are the same asset with lower polygon counts, which then CRYENGINE will swap out automatically based on how far the asset is to the camera in order to save performance. It is recommended that only Phong shaders are used, since they approach the shaders within CRYENGINE the closest.

It is very important that you name your geometry correctly, preferable all in small letters.

Creating the CryExportNode

To create the CryExportNode within Maya, we need to select the geometry first, then select the Crytek tool shelf and click on the Tools button. That will open up the Cry Tools window.

In there we click on Create CryExportNode. That will create the CrytekExportNode and open the window Create CrytekExportNode. In there we name our asset, since this will create the .cgf. We make sure that the file type is set to "Geometry (.CGF)" and then click on the Create button in that window.

If we look in the Outliner we'll see that a "cryExportNode_name of the asset" has been created. By expanding the cryExportNode, we see that there's another group below. We now select the asset and move it into the group that is parented under the "cryExportNode".

Setting up the Collision Proxy, Assigning and Naming the Shader and how to Declare it as a Proxy Primitive

To correctly set up our collision proxy geometry, firstly we have to select it and in the Outliner, move it into the same group under the "cryExportNode" as our main geometry is parented.

As a next step we open up the Hypershade and create a Phong shader. We name the shader "proxy_mat". We now open the shader attributes and set the color to red and it's transparency to 50%. Once that is done we assign this shader to our Proxy geometry.

You should only use proxy primitives as much as possible since it's the cheapest and fastest for CRYENGINE. To declare our Proxy geometry as a primitive (only primitive geometry like cubes, cylinders and spheres can be used for that, and we can have as much geometry primitives as we need to), we click in the tool shelf Crytek and click on the button labeled UDP (User Defined Properties). This will open up another window, in there we type what type of proxy primitive we want it to be (Cube/Box, Cylinder, Sphere or Capsule), click on Save and close the window. Now our Proxy geometry has been defined as a Proxy collision primitive and will be displayed and used as such.

Setting up the Shading Groups and setting the Proxy Shader to the correct Proxy material

To export the asset successfully from Maya into CRYENGINE, we need to set up a Shading Group. A Shading Group contains all the materials assigned to the geometry and numbers them. In CRYENGINE we see the Shading Group as our Material and the Materials grouped under it as Sub Materials, which also has to have included our Proxy Material.

To start out we have to select our main geometry and our proxy geometry. With our geometry selected we click the Crytek shelf and click on the MAT.ED button. That opens the "Material Groups" window. In that we click on Create Group and name our Material Group, you should name the group the same as you named the cryExportNode and we click Ok. Now you can see the name of the shading group on the left column under "Material Groups".

To load in the shaders that are currently assigned to the geometry, we need to click on the right column Shaders on the Add Shaders From Selected Geom. As you can see it loads in the the materials that the are assigned to our geometry and it numbers it. It is very important that our proxy material is always the first material. To move the materials you just have to select the material in the Shaders window and click on the buttons Move Shaders Up/Move Shaders Down.

The proxy material still needs to be tagged as such for the CRYENGINE. To do that we open up the Hypershade and open up the Attribute Editor of our proxy material. Once the Attribute Editor is open we scroll down to Extra Attributes tab and expand it. There we have a drop down menu right next to the Physicalize, which we set to ProxyNoDraw. Now our proxy material is tagged as such for CRYENGINE.

Creating the LOD groups

To create the LOD groups, we need to create an empty group under the Node that is parented to the cryExportNode and name it "_lod1_assetName_group", for the subsequent LODs we also create them, naming them "_lod2_assetName_group", etc.

Once we have our LOD groups, parent the geometry under the respective groups.


Exporting the Asset from Maya

Now that we have all set up, we're going to export the asset from Maya. To do that select in the Outliner the cryExportNode. We then select Crytek in the Tool Shelf and click on the Export button. That will open the Crytek Export window.

In there we click on Generate Material Files button, this will save out a crytek shader in the same location as we saved out before our maya file. Name that shader the same as your asset.

After that, still with the cryExportNode selected click on the button Export Selected. Now the asset will export into the same location we saved our Maya file.


Loading and checking the Asset in CRYENGINE

To load the asset into Sandbox open up the "RollupBar" and click on the "Brush" button. With the filter option you can search for it. Select the asset and drag it into the scene.

To check if everything exported correctly we open up the Material Editor. There the main Material (Shading Group) and all the submaterials (the materials that were assigned to our geometry) should be visible. The Proxy Material should be in the first slot.

You won't see the material since it was set to noDraw so it's invisible. Select each submaterial and load in the correct textures into the right slots. As you can see by checking the proxy it is also present and defined as a primitive.