Tutorial: How to Import and Use the FBX Importer...Tutorial: How to Import and Use the FBX Importer...

14
Tutorial: How to Import and Use the FBX Importer This tutorial walks you through the steps to import FBX files using Lumberyard’s FBX Importer including adding rules and adjusting settings. You will learn how to do the following: Import a Skinned Mesh FBX Import an FBX with Animated Bones Import an FBX with Geometry, LODS and Adding Rules Import a Skinned mesh FBX File with Blendshapes Prerequisites The FBX_Sample.zip file is provided if you want to follow along step by step, and can be Downloaded Here Otherwise, you can easily follow along with your own assets. Step 1: Import a Skinned Mesh FBX The first step in the tutorial is to import a skinned mesh fbx file. 1. Start by copying the FBX_Sample folder into your dev/SamplesProject/Objects directory. This will vary depending on what drive you installed Lumberyard on. 2. Launch the Lumberyard Editor. For this project we will use the default level settings. 3. Go to File > Import FBX File… 4. In the FBX Importer panel, Click on the Open File Button and navigate to the dev/SamplesProject/Objects/FBX_Sample folder. (this is the location you saved the downloaded assets in from step one)

Transcript of Tutorial: How to Import and Use the FBX Importer...Tutorial: How to Import and Use the FBX Importer...

Tutorial: How to Import and Use the FBX Importer This tutorial walks you through the steps to import FBX files using Lumberyard’s FBX Importer including adding rules and adjusting settings.

You will learn how to do the following:

• Import a Skinned Mesh FBX • Import an FBX with Animated Bones • Import an FBX with Geometry, LODS and Adding Rules • Import a Skinned mesh FBX File with Blendshapes

Prerequisites The FBX_Sample.zip file is provided if you want to follow along step by step, and can be Downloaded Here Otherwise, you can easily follow along with your own assets.

Step 1: Import a Skinned Mesh FBX The first step in the tutorial is to import a skinned mesh fbx file.

1. Start by copying the FBX_Sample folder into your dev/SamplesProject/Objects directory. This will vary depending on what drive you installed Lumberyard on.

2. Launch the Lumberyard Editor. For this project we will use the default level settings.

3. Go to File > Import FBX File…

4. In the FBX Importer panel, Click on the Open File Button and navigate to the dev/SamplesProject/Objects/FBX_Sample folder. (this is the location you saved the downloaded assets in from step one)

5. Click on the chicken_ZUp.fbx file and press Open

The FBX Importer (Preview) window should appear. Because the FBX file contains a skeleton and skin information, a Rigs tab will appear.

6. In the Rigs tab, a Skin Group and Skeleton Group should be visible. a) A Skin Group is a skinned mesh in your FBX that you would like to import b) A Skeleton Group is a skeleton in your FBX that you would like to import.

The Group Name is shown as chicken_ZUp. This name can be changed by clicking on the Group Name field and renaming it as you desire. For this case, let’s leave the name as it is.

7. For Select Skins, you can change the skins that you want to import by clicking on the button on the far right. After clicking on the button, a hierarchy of the character bones and skin will appear. All skins with a blue checkbox will be imported.

You can uncheck the skin files that you don’t want to import into the editor. Let’s go ahead and hit cancel button because we will want to import all skin files. If you don’t make any changes, the Update button will look inactive. When changes are made in the FBX Importer window and you press the Update button, an .assetinfo file is created in the same location where the FBX file was imported. This .assetinfo file stores the settings that were changed using the FBX Importer. The original fbx file stays intact for a non-destructive workflow. Lumberyard’s Asset Processor will automatically create a .chr and .skin file when a skinned mesh FBX is added to a game project including when FBX files are changed. These files are stored in the cache. When a new character is created in Geppetto, the .chr and .skin file are needed to construct the character .cdf file. To confirm that the files have been imported you can navigate to this folder: ...\dev\Cache\SamplesProject\pc\samplesproject\objects\fbx_sample, Here you should see the .chr and .skin files we just processed out of the FBX files.

You have now successfully imported a skinned mesh fbx file. In the next lesson, you will learn how to import an fbx with animated bones.

Step 2: Import an FBX with Animated Bones The second step in this tutorial is to import character animations.

1. Go to File > Import FBX File.

2. Click on Open File and navigate to the same FBX_Sample folder from the previous tutorial.

3. Click on the anim_chicken_flappingcrazy_ZUp.fbx file and press Open.

4. The FBX Importer (Preview) window should appear.

Because the FBX file contains skeleton information, a Rigs tab will appear. Because there are keyframes on the skeleton of the FBX file, an Animations tab will also appear. You can use this animation in Geppetto after correctly setting up your character cdf, skeleton list and chrparams. Notice that there is no Meshes tab because only the animated bones were included in the fbx file. To confirm that the files have been imported you can navigate to this folder: ...\dev\Cache\SamplesProject\pc\samplesproject\objects\fbx_sample, here you should see the .caf file that we just processed.

You have now successfully imported an FBX file with animation.

Step 3: Import an FBX with Geometry, LODs and Adding Rules The third step in this tutorial is to add an FBX file with just geometry only.

1. Go to File > Import FBX File

2. Click on Open File and navigate to the same FBX_Sample folder from the previous tutorial.

3. Click on the chicken.fbx file and press Open.

4. The FBX Importer (Preview) window should appear.

5. Because the FBX file contains only geometry information, only a Meshes tab will appear. Any FBX file with geometry will display a Meshes tab.

6. You will notice two rules that are displayed in the mesh group: Material and Level of Detail. Rules provide a useful, extensible and flexible way to change the default settings of the fbx.

a) For the Material rule, Update Materials will update any existing .mtl file to use the same settings as the fbx file. Remove Unused Materials will remove any material present in an existing .mtl file not present in the fbx file. Let’s check Remove Unused Materials.

b) For the Level of Detail rule, you will notice that LOD meshes were automatically assigned in LOD 0.

For this chicken, there are geometry named with the suffix _lod1 in the fbx. Any geometry with a suffix using _lod1, _lod2, _lod3, _lod4 or _lod5 will automatically be recognized and the FBX Importer will populate the Mesh Group with a Level of Detail Rule. The _lod1 to _lod5 suffix are soft naming conventions that can help speed up your workflow.

7. To view the LODs that will be included in the import, click on the button and a list of geometry will appear. Meshes with the blue checked box will be the LODS included in the import. You can choose to uncheck any of the LODs if you choose. For this example, let’s uncheck the chicken_feet_lod1 by clicking on the checkbox. Press Select to apply your change.

8. Additional Rules can be added to your Mesh Group. Click on the Add Rule button, and choose Comment. In the Comment field, type in Edited by “your name”. Comments may be added as a way to communicate with other team members and are strictly informational. Comments do not affect the processed files.

9. Let’s add another Rule. Click on the Add Rule button and choose Origin. Change the Translate X value to 10. This will move the imported meshes to a position of X =10, Y = 0, Z = 0 relative to the default origin node. You have the option to change the Relative Origin Node by using the pulldown adjacent to it and selecting from the available mesh groups. The final position of the mesh will depend on the pivot point of the mesh group.

10. Let’s add another Rule. Click on the Add Rule button and choose Mesh (Advanced). Note that Merge Meshes is checked on as default but you can uncheck that if you want meshes to be separated. You can choose to select 32-bit to set a higher precision in vertex data.

11. Press the Update button to save all your changes. Just remember that these changes do not affect the original FBX file but instead creates a .assetinfo file and saves the rules that were applied.

You have now successfully imported an FBX file with Geometry, LODs and applied some rules that will update the .assetinfo file. You can find the chicken.fbx.assetinfo file in this location. …\dev\SamplesProject\Objects\FBX_Sample

Step 4: Import a Skinned Mesh FBX with Blendshapes In the previous tutorial, you learned how to import a skinned mesh. In this tutorial you will learn how to import a skinned mesh with blendshapes and add some rules.

1. Go to File > Import FBX File.

2. Click on Open File and navigate to the same FBX_Sample folder from the previous tutorial.

3. Click on the chickenWithShapes.fbx file and press Open

4. In the Rigs tab, you will notice that a Blendshapes rule is displayed. This is because the fbx file contained blendshapes and the FBX Importer will automatically populate the Skin Group with a Blendshape rule.

5. Press the button to the far right of Blendshapes. After pressing the button, a window showing the meshes and skeleton hierarchy will appear. All blendshapes that have a blue checked box will be included and generated in your import. You can remove the blend shape that you want imported by unchecking the box adjacent to it. Let’s go ahead and uncheck the chicken_body_blowup and press Select. This will exclude that blendshape from the import and save the settings in the .assetinfo file.

6. Press the Update button to save all your changes.

You have now learned how to import a skinned mesh with a blendshape and remove a blendshape that you don’t want imported in the engine.