Tutorial: Exporting characters (Max) - Amazon Simple Storage Service ...

Report 4 Downloads 121 Views
Tutorial: Exporting characters (Max) This tutorial walks you through the steps needed to get a character into Lumberyard, including how to export the character’s skin, skeleton and material. Character and material setup in Lumberyard will be covered in different series. 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: •

Exporting a character’s skin, skeleton and material from Max to Lumberyard

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

Lumberyard 1.6.0.0 installed or later Autodesk 3ds Max 2014 or later versions Lumberyard Max plugin and exporter installed through SetupAssistant 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 Max to Lumberyard, we have to export it using the Max Lumberyard Exporter. To export a character’s skin, skeleton, and material from Max 1. Run the version of Max that you have installed on your system and for which you have installed the Lumberyard tools and plug-in. Open the Max file for the character asset you are want to export. If you are importing an asset, make sure you save the scene as a Max file, otherwise during the export process you will be given a warning to save the scene first.

2. If you are using the sample FBX asset, you will need to add a dummy node and use that as your new root bone for your skeleton export. The original character.fbx was exported from Maya, so the bone rotations for jx_c_origin are not zeroed out when coming into Max because of the Y-up orientation default for Maya. In this tutorial, the dummy is given the name jx_c_root. Be sure your dummy is zeroed out in translation and in rotation before making it the parent of the jx_c_origin bone, or you will end up with an invalid skeleton in Lumberyard.

3. To prepare the material for export, you will need to set up a material. If you have multiple materials assigned to your mesh, they will need to be part of a Multi/Sub-Object material.

Note: You will also want to convert any of your individual materials to Crytek Shader materials to avoid any warnings on export. If you imported an asset, you will have to add the material to the Material Editor in Max by using the eyedropper. For this tutorial, I named the Multi/SubObject material to character_mat.

4. Depending on the version of Max you are using, you may have to switch from a Skin modifier to a CrySkin modifier. We recommend you use CrySkin for versions before Max 2015 Service Pack 3 / Extension 2. The reason is that in older versions, Dual Quanternion skinning was not supported, and CrySkin gives you accurate representation with skin deformations as you would see from Lumberyard. In this tutorial, we are using Max 2016 so the character is using the Skin modifier. To switch from the Skin modifier to CrySkin, you will want to save your envelope skin weight data from the Advanced Parameters section under the Skin modifier. Then you can remove the Skin modifier, and apply a CrySkin modifier. Through the same Advanced Parameters section under the CrySkin modifier, you can load your saved envelope skin weight data.

5. Open the Lumberyard Exporter from the Utilities Panel and select your character’s skin that you want to export.

6. Click on the Add Selected button under the Geometry Export section in the Lumberyard Exporter. The character’s skin will be added to the Geometry Export list, which you will need to assign the .SKIN extension for meshes that have any skin weight data. Click on the drop down menu for Export format to set .SKIN type. You have the option to rename the exported version of the skin, but the default will just inherit the same name as the Max file.

7. You may want to change the name of your asset or choose a custom export path if you do not want your exported mesh to default to the same location as your Max file. In this case, I am exporting this mesh under the Objects\Tutorials\Biped directory under my game project for Lumberyard. You will also have to type in the name of the asset if you are assigning a custom export path, otherwise you will be unable to assign a custom path.

8. When you added your skin to the Geometry Export list, it should have auto-added the root bone or dummy node for your skeleton under the Animation Export list. This is done by default if the Use object bones (Lock) checkbox is on. If you did not have the checkbox on, you will need to manually add your root bone to the list.

9. To export the character’s skin, click on the Export Nodes button.

If you get any errors, be sure to read them to help indicate what may be wrong. If you are successful, you should see the Lumberyard Exporter log window disappear.

10. In order to export the character’s skeleton, change your export format to the .CHR extension for character skeleton. You will also want to enable the Export file per node checkbox so it knows to export the root bone with its children, which it is obtaining the root bone from the Animation Export list.

11. To export the character’s skeleton, click on the Export Nodes button.

If you get any warnings or errors, be sure to read them to help indicate what may be wrong. If you are successful, you should see the Lumberyard Exporter log window disappear. If you are successful with warnings, the Lumberyard Exporter log window will remain to inform you of the warnings.

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.

12. Now that the character has been exported, you will want to export out the materials. You should have already prepared your material(s) back on step 4. You will want to have the Lumberyard Editor running before exporting a material from Max To launch the Editor, open Setup Assistant and click Launch Lumberyard or run the Editor from your Start menu. Note: You may want to make a shortcut to the Editor on your desktop or pin the program to your taskbar.

13. You must close the Welcome to Lumberyard Editor window in order for the material editor in Lumberyard to generate your material when you export it from Max.

14. In Max, open the Material Editor and select the material you want to export.

15. In the Lumberyard Exporter, scroll down to the Material section and click on the Create Material button.

16. The Save As window will pop up for you to choose a location to save your material. In this case, I will choose the same location that I saved my character’s skin (.SKIN) and skeleton (.CHR). I will also give the material the same name as my Multi/Sub-Object material that is assigned to the character in Max, which in this case is named character_mat. Note: It is important that the name you assign to your material you’re saving in Lumberyard be the same as the name that was assigned in Max for the material to map correctly to the mesh. 17. You should now see your material loaded up in the Material Editor in Lumberyard, which means you have successfully exported the material.

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 and skeleton 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 (Max)

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.