We've navigated to our prebuilt cars that we created as custom Asset Forge collection assets earlier. Now we'll explore exporting from Asset Forge into Unreal Engine using both OBJ and FBX file formats.
Lets bring in the first blue car vehicle. Center the asset and then we will export to OBJ with merge blocks selected. Though in this assets case it does not matter as the asset blocks have all already been merged together. Then save the OBJ file as `blue-car`. Next switch export format to FBX and save the FBX file as `blue-car`. Now remove the blue car from the scene and drag and drop the red truck into the editor. We will follow the same process `3D Model > OBJ + Merge Blocks > Save File` to export our red truck to OBJ and FBX formats. First export to OBJ file format and name the file `red-truck`. Then export in the FBX format with the same red-truck file name.
To test multiple mesh export I'll build a quick train locomotive body with our previously built asset blocks from Maya. Quickly build out a body and make sure the materials all match. Then export as an OBJ without merging the blocks and name it `locomotive-unmerged` then export still as an OBJ but this time we'll merge the blocks and name the file `locomotive-merged`. Lastly, lets export our locomotive in the FBX file format and name it `locomotive`.
Now open up Unreal Engine, for this import test I've created a new Unreal Engine project using the Vehicle Example starter project. This way we have another asset we can compare our scaling to. Right click in the `Content Browser > Import to ....` and select our first file the `blue-car.obj` file. For our first pass we won't change any of the default import settings though we know we will need to change the uniform scale later because Asset Forge's scale is 1 cubic centimeter for each primitive block. Click import and you will notice a few errors such as smoothing groups and specifically the warning about mesh size which we'll fix next. Open up the Mesh and you'll notice how small the mesh is that was imported. To fix this we'll delete the imported object along with it's materials. Create a new folder for our future test imports and then reimport our blue-car asset. This time because we know the scale of our environment we'll set the uniform scale to 150. Note that the scale for your game will depend on your existing assets and your workflow. I'll also change the `X` import Rotation from `0.0` to `90.0` so that the car is properly oriented. You'll get the normal warning messages about smoothing which we can ignore. Dragging our new asset into the scene we can see our asset matches the existing assets scale and sizing. Perfectly good for programmer art or even a stylized game asset. Do the same for our red-truck asset, setting `Import Uniform Scale` to `150.0`. Again ignore the warnings about smooth groups for now. Bringing our red truck into the scene as well and we have another properly scaled asset we can use within our game.
Now how might we handle OBJ asset files that are not merged together. Unmerged assets can be useful depending on your game if it has cosmetic customization objects for instance that might swap out on the base object. Importing the `locomotive-merged.obj` asset it will import just like our car assets as one single asset object. However, importing our `locomotive-unmerged.obj` asset we get our individual asset blocks. This way we can build out our locomotive bodies in the game engine. This can also be useful if you are creating environment building blocks that you can use to piece together and quickly build or block out your level design.
Lets focus on importing our FBX asset files now. Import the `blue-car.fbx` asset file first and leave the default import settings. Compared to the OBJ imports the default FBX files will be overly massive in scale but they will have the correct `X Rotation`. With some trial and error I found the proper FBX import uniform scale to be approximately `0.15`. This scales our asset down to the relative scale of the existing vehicle example in the scene. Now we'll import the locomotive FBX asset file setting the uniform scale to `0.15`. Remember that the FBX export did not have the option for grouping or merging the mesh bodies and thus will import all the mesh bodies as separate asset entities.
Hopefully this gave you a good overview of how to incorporate Asset Forge into your art asset pipeline and some of the pitfalls you may run into. Keep in mind if you want to optimize your assets from Asset Forge you may want to bring them into a 3D CAD program like Maya or Blender to clean up the geometry and delete unused faces. However, for programmer art, starter assets, and even 2D Sprites Asset Forge can be a great tool.
Copyright 2016-2020 UE Casts. All Rights Reserved.