Wednesday, 18 November 2015

Practical Skills for Computer Games design - Exporting from Maya/Importing into Unreal

Preparing a mesh for Export.

To prepare each mesh for export from Maya into Unreal Engine 4, each model I create through this unit must have two individual sets of UVs assigned, the first of these is applied to the model for visual render purposes, the data for Diffuse, Normal, Specular and any other maps will adopt this UV set and will textures will be laid out as such.
The second UV set is generally used solely for Light Maps, these are the maps which hold the shadow rendering data for each individual mesh. Without shadows, a finalised textured mesh lacks a certain element of realism, and does not look as good as it otherwise could.
These UV maps may not end up looking identical at all, but for the purpose of this post, the maps have been simply transferred to the new UV set.


Most game engines prefer a model to be built or placed at the centre of the world, giving the mesh a relative point to begin rendering from.
To transfer a mesh to the centre of the world it is very simple, the pivot point is selected as desired by holding D to access the pivot itself, then holding V to snap the pivot to a specific vertex, holding X following this will allow the mesh to be snapped to the grid via its newly assigned pivot point.
Once the mesh is positioned at the centre of the viewport, the values are then frozen, returning each respective translate, scale and rotate value to ‘0’.




One more accountable feature which must be taken into account when exporting a mesh is the mesh’s history.
As a mesh is modelled, each manipulation through the modelling and UVing processes creates a stack of history type data, this will need to be removed in general, when a mesh is finalised and ready for transportation into a game engine.
To remove modelling history, from the top toolbar, select Edit > Delete by type > History, this will remove the history data from the file.


Any other manipulations made to the model will also need to be coupled with a deletion of history and freeze of transformations, these can include for example scale manipulations with regards the scales needing to be worked to in various game engines.

To further prepare the mesh for export/import from Maya to Unreal, I have applied an example texture to my mesh, disregarding the UVs for the time being.



This UVing, positioning and history removal process when applied correctly, will ready a mesh for transport into a game engine.

Exporting the mesh.

To export a mesh, it must first be selected, once selected, navigate to File > Export Selection, this will bring up a dialogue box allowing the user to name their export and select their file type, the file type I will be using to export ready for Unreal is FBX.


The next screen I am presented with is the FBX Exporter menu, within this screen multiple options will need to be selected, though they are not necessarily a mandatory selection right now, further down the line they will be and as such I will be keeping them selected now.
The optioned which will need to be or remain selected are as follows;
From the expanded Geometry menu:
- Smoothing Groups
- Smooth Mesh
- Triangulate

From the expanded Advanced Options menu > FBX File Format
- Version: FBX 2013


With these options selected, provided the scene has been saved in case of errors/crashes within the export process, the mesh can be exported via clicking the Export button.

If the model exports without errors it is ready to be imported into Unreal, however if there are any errors, or the model does not export correctly, everything I have documented must be looked at and assessed, if the model:
1. At the centre of the world?
2. Free from a history backlog?
3. UV'd?

If these are all correct then issues may be deeper, within the model itself and the model itself must be assessed for errors.

Importing the mesh into Unreal 4.

To begin, Unreal 4 is opened up, having previously made sure the engine is up to date (it is useful to check very frequently for any updates, to keep any possible downloads down to a minimum.) For the purpose of this exercise I am opening Unreal Egine 4.9.2.



Creating a project folder will place the named folder in the documents directory, this can be transferred to another PC via a hard drive, the folder can be located on a different letter drive (for example a C: or D: drive if booting OS from a Solid State Drive.)

Through working in Unreal Engine 4, the size of the folder will grow exponentially in size, so when working on specific aspect of a project, the respective folder within the file structure can be copied across on it's own, as to avoid having to copy the entire project folder across every time the project is updated from different PCs.

On the left hand side of the User Interface is the Content Browser, from here I can import my basic Containment Chamber shape, with test texture included.


Upon importing my mesh the first time, I was presented with an error as I had not yet scaled my mesh up to a level at which it would be appropriate for use within Unreal Engine 4, I scales a single cube up to an appropriate size for a character as the containment chamber is built with a view to contain a character.
Following the creation of a character sized cube (180 units high), I then scaled my containment chamber accordingly, I reached a scale of 25.46, taking into account the size of the original mesh at a scale of 1 (Having frozen the transformations previously), them re-imported my mesh into UE4.
The scale felt fitting at 25.46, though for each of use, I lowered the scale to 25 and reimported once again.
The result can be seen below, sized in comparison with two default chairs and a table within the viewport in Unreal Engine 4.


For the purpose of this task, I am happy with the scaling of my example containment chamber import, as I feel this would hold a character well in both height, width and depth, but once more I am seeking peer opinions on the matter.

I have again been tasked with producing 3 questions to ask my peers, my 3 questions were as follows:

Question 1:
As my plan was to create a containment chamber for a humanoid specimen or otherwise I have scaled my mesh to a size at which I feel a human could be suspended inside. Are there any changes you would make in the scaling of the mesh? For example should it be bigger or smaller? Slimmer or wider?
Question 2:As highlighted in the last session of peer review, some peers could not immediately tell which side was the front of the mesh and which was the rear, I intend on making this clearer within the high polygonal mesh as the front panel is intended to be flush.
Do you have any suggestions which I can build on to represent the front of the mesh more clearly to fresh eyes?
Question 3:Combined with a metallic outer body and a transparent glass chamber, I am contemplating inserting a light at the bottom of the chamber, effectively illuminating the contained specimen, is this something which you would find aesthetically pleasing and why? Are there any ways in which you think the idea could be improved?
As with previous review cycles, the feedback was mostly positive, with one main standout point which has been made.
The point risen is scale related, in that the chamber may not be tall enough, or in some cases wide enough, dependent on the "specimen" inside. I will most certainly be considering different types of chamber sizes.
Another suggestion was made for further production, an idea which resonated with an original design idea I had already had. I am aiming to have a 'specimen' suspended in the chamber and as the chamber is filled with liquid, I intend on having a very slow current passing over them.
I will most certainly take these points into account for further development and use the feedback to build upon my current position.

No comments:

Post a Comment