UE4 – Tiny tips for tiny scale projects

Software:
Unreal Engine 4.26

When having to develop a UE4 project that deals with a tiny world scale, like the whole level being less the 50cm size for example,
The following steps may help make the project more easily navigate-able and convenient to work on.

  1. Scale down the camera Icon:
    UE4 has by default a huge, bulky, opaque camera icon.
    For a tiny scale project, this camera icon may cover the whole level and be very inconvenient to work with.
    Select the relevant camera component and scale it down.
    In my tests, this modified camera matrix isn’t breaking the camera optics in any way,
    But if you want to have no such scale offsets in your project, you can also replace the camera icon with a suitable small one.
  2. In Editor Preferences > Viewport:
    Decrease both:
    Mouse Scroll Camera Speed and Mouse Sensitivity
    To allow finer navigation at small scale

Note:
A global scale conversion factor can be used instead of taking these measures,
And in many cases this can be a more practical solution for managing a sub 50cm world,
For example, building everything 100X size so that 1 meter will be representing 1 centimeter in your project’s world.
But take into account, that if the project demands rendering realistic physical lighting and optics, extra conversions will have to be made to account for the scale conversion factor, so is such cases it may be better to setup a real-world scale project.

UE4 – Replace the Camera component icon

Software:
Unreal Engine 4.26

Note:
This seems like an awkward workaround..
So if I missed something here, and there’s a better method to do this,
I’ll be very grateful is you share it in the comments.
Also,
The following tip is only relevant for the CineCameraActor and won’t work with a regular CameraActor as it has a different built in offset (hopefully, I’ll have time to add this to the post later..)

Replacing the camera icon:
Its fairly simple to replace the Camera component’s mesh icon,
Just select the component and replace it’s Camera Mesh Static Mesh component with a different static mesh object:

So what’s the problem?
The problem is that the default mesh used for the camera icon doesn’t have its natural pivot at the focal point of the camera, but at its bottom somewhere,
And there is a hardcoded transform offset that compensates for that and places the icon mesh in a way that has the Icon lens roughly at the actual Camera actor pivot / focal point:

* I haven’t found any exposed transform parameter that allows moving the icon itself without moving the camera.
So in-order to replace the camera mesh with an alternative icon mesh, and have it be aligned properly to the camera’s pivot / focal point (without changing engine code and building it) the built-in offset must be negatively pre-added to the new mesh model:

In this example in Blender, a new icon is modeled facing positive Y, with pre-built offset to compensate for the hardcoded offset in UE.

The Camera actor with the alternative Icon:

Note:
In this example, I’ve replaced the camera icon with a much smaller model, intentionally, to suite a tiny scale project,
You can also scale the icon without replacing the model.

Blender to Unreal Engine tips

Software:
Blender 2.9 | Unreal Engine 4.25

The following is a list of guidelines for preparation and export of 3D content from Blender to Unreal Engine 4 via the FBX file format.

Disclaimer:
This is not a formal specification.
It’s a list of tips I found to work well in my own experience.
* Some of the issues listed here may have already been solved


Blender Scene and model settings:

System units in Blender:
Define the scene units in Blender as:
Metric unit with 0.01 scale (centimeters)
And model your content correctly using centimeter units.
* Modeling in 1 meter units may seem to be imported correctly into UE4 but will cause unsolvable problems like a skeletal mesh physics asset having incorrect auto-generated shapes, a problem that in my experience can’t be fixed manually.

Transform:
Model your model in Blender facing the -Y world axis, +Z obviously being up (obviously for Blender).
* This way the model is aligned to Blender’s views so the front view displays the model’s front etc.
Make sure to apply your model’s transformations before export.

Armatures:
Make sure the Armature object isn’t named “Armature”.
naming or leaving the Blender skeleton named “Armature” will cause the UE4 importer to fail due to “multiple roots”.
* Also remember some weird related bug with animation scale incorrectly imported, but can’t confirm this now..
No need for a dedicated root bone in the hierarchy. the Armature object is the root of the bone hierarchy.
* See export option below

Texture baking:
Set the normal map’s green channel to -Y.
* This is not critical at all because if baked as +Y it can easily be fixed in UE4.

Metadata:
Blender custom properties import as UE4 asset metadata that can be read by editor scripts for automation purposes.
* See export option below


FBX Blender export and UE4 import settings:

I recommend saving an FBX export preset with these settings.

Optional:
I prefer the export settings to include only selected objects.
* It’s more efficient for me to select the specifics objects I want to export into a single FBX file prior to export, than to delete all the temp / reference / draft objects from the scene.
If you want to export Blender custom properties with to the FBX check the “Custom Properties” option

Axes:
Blender’s native model/world orientation is model’s forward facing the -Y axis, left side facing +X and of-course up facing +Z.
UE4’s native model/world orientation is model’s forward facing the +X axis, left side facing -Y and up facing +Z.
There are axis settings in Blender’s FBX export module, that theoretically, should be set like this:

However, in tests I did, The axis settings made no difference when importing to UE4, even when setting intentionally incorrect upside-down axes.
Maybe the FBX exporter writes these settings to metadata that the UE4 importer doesn’t read..
From my experience, what’s important is to orient the model correctly in Blender (see above), apply the transformations,
And in the UE4 import menu, check the “Force Front XAxis” option:

Geometry:
Make sure either “Edge” or “Face” is chosen in the “Smoothing” option to import the mesh’s smooth shading correctly ans avoid a smoothing groups warning on import:

Optional:
Depending on how much control you need over the mesh’s tangent space,
You may want to check the “Tangent Space” export option,
This will make Blender export the full tangent space to the FBX and make UE4 read it from FBX instead of generate it automatically.
* For this option to be supported, the mesh geometry must have only triangle or quad polys.
In the UE4 import settings, choose the “Import Normals and Tangents” option in “Normal Import Method”:

Armature:
Set “Armature FBXNode Type” to “Root”.
Uncheck the “Add Leaf Bones” option to avoid adding unneeded end bones.
Set bones primary axis as X, and secondary axis as -Z.

Animation:
Uncheck “All Actions” to avoid exporting actions that don’t actually belong to the skeleton.
* Un-related animations in the FBX can also corrupt the character rest pose in UE.
The “NLA Strips” option is useful for exporting a library of animations with the skeleton.
* In Blender’s NLA editor, activate the actions you want exported to the FBX.


Related:
3ds max & V-Ray to UE4 Datasmith workflow

UE4 – Change the size of the UI and fonts

Software:
Unreal Engine 4.24

To Change the size of the UI and fonts in the Unreal Editor:

  1. Select:
    Window > Developer Tools > Widget Reflector
    To open the Widget Reflector window
    Annotation 2020-04-23 150847
  2. In the Widget Reflector window, change the Application Scale parameter:
    Annotation 2020-04-23 151022

UE4 – Package a Project for Windows

Software:
Unreal Engine 4.25

Basic steps for packaging a simple UE4 project for Windows:

Package settings:
Open the Project Settings window:
Untitled-1.jpg

  1. In: Project > Description
    Set the project’s details and thumbnail:
    > The Project thumbnail will apear in the UE4 Editor browser.
    > Thumbnail image must be a 192 x 192 resolution PNG
    Untitled-4
  2. In: Project > Maps & Modes
    Set default level (Map) for the project:
    Untitled-5
  3. In: Project > Packaging
    Choose build configuration
    > For final distribution choose ‘Shipping‘:
    Untitled-6
  4. In: Project > Supported Platforms:
    Make sure Windows is selected:
    Untitled-7.jpg

Setting user input focus:
* So the user doesn’t have to mouse click the screen before being able to control the game.
Select the FirstPersonCharacter Actor and enter editing mode.
In the Event Graph Blueprint, locate the Event BeginPlay node, add a Set Input Game Only node, after it, and connect a Get Player Controller node set to index 0, to it’s Player Controller input:
Annotation 2020-07-14 175909
Note that if there are UI user interactions, in the game, you may need to switch to different input modes during the game to allow interaction with UI.

Adding a Quit command:
Select the FirstPersonCharacter Actor and enter editing mode.
In the Event Graph Blueprint, add an Escape key press Event node,
And connect it to a Quit Game command node.

Untitled-9.jpg

 

Creating the game package:
Choose:
File > Package Project > Windows > Windows (64-bit)
And select an output folder.

Untitled-8.jpg

A folder named “WindowsNoEditor” will be created,
And inside it will be the game executable along with code and assets folders.
This package can be renamed and copied to other locations.

 

Possible causes for packaging failure:
There are many reasons packaging a UE project can fail,
I certainly don’t know all of them, but I’ll list some cases I actually encountered:

  1. If the project folder is located within a deep folder structure, packaging errors may occur because of long file paths.
    * Sorry I didn’t save the actual error message..
  2. Installing a plugin twice by mistake will cause the following error:
    Error: System.ArgumentException: An item with the same key has already been added.
    * I mistakenly installed the Houdini engine plugin both in the Plugins\Runtime folder and in the Plugins folder (this specific plugin should be only in Plugins\Runtime).

 

Related posts:

  1. UE4 – 3ds max & V-Ray Datasmith workflow
  2. Cleanup the FPS project template for Archvis 

 

Unreal Engine 3D viewport navigation

Software:
Unreal Engine 4.18

LMB Drag – move horizontally on the X Y plane.

MMB Drag – move on the viewing vertical plane (to the sides and up / down ).

RMB Drag – Rotate (Pan) the view without moving.

Alt + LMB Drag – Arc Rotate view

Alt + RMB Drag – Dolly In / Out view (move forward and back ward along viewing axis)

F – Frame Selection (Zoom Extents)