Tutorial: Exporting characters (Maya)

Report 2 Downloads 157 Views
Tutorial: Exporting characters (Maya) This tutorial walks you through the steps needed to get a character exported from Maya and ready for importing into Lumberyard, including how to export the character’s skin, skeleton and materials. At the end of the tutorial you will have exported the character’s skin, skeleton, and materials. You will learn how to do the following: •

Export a character’s skin, skeleton and materials from Maya to Lumberyard

Prerequisites You must have the following before starting this tutorial: • • • •

Lumberyard 1.6.0.0 installed or later Autodesk Maya 2014 or later versions Lumberyard Maya plugin and exporter installed through Setup Assistant Sample asset is included with Lumberyard. It can be found where you installed Lumberyard under: ...\dev\SamplesProject\Objects\Tutorials\Biped\character.fbx

Step 1: Exporting a character’s skin, skeleton and material To get a character from Maya to Lumberyard, we have to export it using the Maya Lumberyard Tools. To export a character’s skin, skeleton, and material from Maya 1. Run the version of Maya that you have installed on your system and for which you have installed the Lumberyard tools and plug-in. Then, open or import the file for the character asset you want to export in Maya. The asset used in this tutorial is located here: a. …\dev\SamplesProject\Objects\Tutorials\Biped\character.fbx 2. Make sure the material that is assigned to the character’s skin isn’t using the default lambert1 material. A new material must be created and applied to the character’s skin in order to export the mesh.

3. Open the Lumberyard Tools from the Lumberyard shelf and select your character’s skin that you want to export.

4. Click on the Add Selected button under the Geometry Export section in the Lumberyard Tools.

5. The character’s skin will be added to the Geometry Export list and because the mesh has skin weight data, it will automatically be assign the .SKIN extension. You have the option to rename the exported version of the skin, but the default will inherit the same name as the mesh.

Note: You can organize your scene in any hierarchy you want. The Lumberyard Tools use name referencing to find the appropriate object to export and this objects is stored under the Lumberyard Export Group Node. This will be covered a little later.

6. If the Maya scene is set to Y-up (Maya’s default), the character’s root joint needs to be oriented a specific way. If you are exporting an existing asset or using the tutorial character, you will need to create a new skeleton joint with the orientation listed below and parent your skeleton under it to export it properly. For this tutorial, the newly created joint name is jx_c_root. The orientation of the root joint will need to be RotationX = -90 and RotationY = 180. If you do not have this orientation set on your root joint, you will get an error on export saying “Skeleton-s root bone orientation is not identity” and your skeleton will fail to export.

Note: If you add the extra oriented root joint and you have animations using the same asset, you will need to add this extra root joint to the animation files as well. 7. Once you’ve ensured your root joint is oriented the proper way, you will need to add the SceneRoot node to your scene. This is required to export a character and it helps the compiler understand which way is up in the scene when compared to the Lumberyard Editor’s world orientation. To do so in the Lumberyard Tools, go up to the Tools menu and click on the Add Scene Root menu item. You should now have a SceneRoot node in your scene. Its orientation will match the orientation of the newly created root joint, jx_c_root.

Note: Exporting multi-skin meshes into a single .skin file is not supported with the Maya exporter. It is recommended to export your multi-skin meshes as individual .skin files. You can add all of your skin mesh nodes to the Geometry Export list, and enable export of the geometry by checking the box that is located to the left of the node. 8. Select the root joint of the character’s skeleton that you want to export and then click on the Add Selected button under the Geometry Export section in the Lumberyard Tools.

9. The character’s skeleton will be added to the Geometry Export list and will be auto-assigned the .CHR extension because it is a joint. You have the option to rename the exported version of the skeleton, but the default will inherit the same name as the root joint and add the suffix “_skel”.

Note: If you have multiple skin mesh nodes in the Geometry Export list, you will need to limit it down to just one skin mesh node to export the skeleton (.chr) file correctly. 10. You may want to choose a custom export path if you do not want your exported character to default to the same location as your Maya file. If you are following along with the FBX asset, you can just keep it set to <default> to export to the same location as the FBX file.

11. The character’s skin and skeleton are ready for exporting, but we will need to set up a material group with our materials listed under it as a sub-materials. If we don’t do this, we will get an error when trying to export our skin. Select your character’s skin again. To add a material group with the materials for the character’s skin, click on the Add Group button under the Material Export section.

If you had the character’s skin selected, this should have auto-created a material group with the materials under it. Otherwise, it would have created an empty material group. If this was the case, you would need to select the material for your skin, have the material group active in the Material Export list, and then click the Add Material button.

12. You have the option to change the name of your material group and the materials assigned to the skin. The default name of the material group will inherit the name of the first material and add the suffix “_matGroup”.

Notice, there is a drop down list next to each material that says No Physics. This is the default setting for materials. There are other options for setting if the object needs to be for collision, ragdoll, and a few other things. You can refer to the documentation on these, but for this tutorial we will keep it set to No Physics.

13. You may want to choose a custom export path if you do not want your exported material group to default to the same location as your Maya file. If you are following along with the FBX asset, you can just keep it set to <default> to export to the same location as the FBX file.

14. To export the character’s skin, skeleton and the materials, you can use the individual export buttons or use the Export All button at the bottom of the Lumberyard Tools window.

If you get any errors, be sure to read them to help indicate what may be wrong. A common example with test assets is that the mesh may not have UVs applied to it. In order to export successfully, each mesh is required to have UVs. If you are successful, you should see the RC compiler window pop up and go away once it is done converting your assets to the appropriate format for the Lumberyard Editor. Note: The skin hot loading feature allows you to preview your changes of your skin mesh without using the Reload Geometry tool or restarting Lumberyard. The hot loaded skin will be picked up by the Asset Processor once a skin is re-exported, and can be viewed through various tools or modes such as Geppetto and Editor Game mode.

15. Something to be aware of, if you look in the Outliner or Hypergraph, you will notice a group node named LUMBERYARD_EXPORT_GROUP. This node is the parent to all of your export data and settings. You will want to keep this in your scene for future exports. If you go further into this node, you will see one that stores the settings, and another node that holds all of your Geometry Export information. There is a separate group node created for each item in the Geometry Export list, with each of the node’s settings. The only information that does not get stored under the LUMBERYARD_EXPORT_GROUP is the material groups and SceneRoot node.

You should now have a .skin, .chr, and .mtl file in the location you specified. As a reminder, we will not be covering the character or material setup in this tutorial because it is covered in a separate tutorial series. You have now successfully exported your character’s skin, skeleton and material to be used in the Lumberyard Editor. Please refer to other tutorials in the related section for next steps.

Related tasks and tutorials Now that you have exported a character and its materials, you should learn how to use the Geppetto tool and assemble a character, or continue learning how to export: • •

Tutorial: Geppetto basics Tutorial: Character creation basics



Tutorial: Exporting animation (Maya)

We’d love to hear from you! Head to our Tutorial Discussion forum to share any feedback you have, including what you do or don’t like about our tutorials or new content you’d like to see in the near future.