We have begun migration of most wikis to our new host, Amazon Web Services. All but the top 100 wikis are in read-only mode until the migration is complete. Estimated completion: End of Week.
- 1 Fast Rundown
- 2 The Fixture Blueprint and its Components
- 3 Creating a Fixture
- 3.1 Fixture Orientation
- 3.2 Fixture Y-Axis Thresholds
- 3.3 Deciding what Sub-Meshes you'll need
- 3.4 Creating the Sub-Meshes
- 3.5 Fixture Mod setup within Unreal Engine 4
- 3.5.1 Creating your Fixture Mod Plugin
- 3.5.2 Folder structure setup
- 3.5.3 Importing files to Unreal Engine
- 3.5.4 Creating the Fixture Blueprint
- 3.5.5 Compile and Save the Fixture Blueprint
- 3.5.6 Creating the fixture thumbnail files
- 4 Additional Notes
- 5 See Also
Fast Rundown[edit | edit source]
- Fixtures are a Blueprint class, A_Fixture is the base class.
- Fixtures are comprised of up to 4 Sub-meshes (UV Mesh, Conforming Mesh, Skinned Mesh, and Additional Mesh).
- All or none of these are required:
- UV Mesh (the silhouette of the cut out)
- Conforming mesh (e.g. Grilles, or the front headlight glass)
- Addditional Mesh (Things like Wing Mirrors)
- Skinned Mesh (Headlight Internals)
- A Fixture Category
- Snap to Centre Strength
- Lock to Cardinal (should it always face forwards, backwards, etc. Rather than face in the direction of the car body normal.)
- Needs Material Slots setup correctly
- Needs Preview Thumbnails
The Fixture Blueprint and its Components[edit | edit source]
A Fixture is composed of a Blueprint that contains the fixture settings and sub-meshes.
Fixture Settings[edit | edit source]
Fixture settings are grouped in to two categories: Editable, and Fixture.
- Editable settings are for the properties of the fixture that gets placed to the car.
- Fixture settings are for where the fixture is located in the Automation UI.
Editable settings[edit | edit source]
- Centre Snap Distance - Defines at what distance the fixture will snap to the centre line of the car (default 10cm)
- Conforming Mesh - Defines the Static Mesh sub-mesh used by this fixture
- UVMesh - Defines the UVMesh sub-mesh used by this fixture
- Skinned Mesh - Defines the Skinned Mesh sub-mesh used by this fixture
- Additional Mesh - Defines the Additional Mesh sub-mesh used by this fixture
- Lock Normal to Cardinal' - When the fixture is set to 'Lock to Cardinal': all the vertices of the Conforming Mesh, all the bones of the Skinned Mesh , and the Additional Mesh, will conform backwards in to the car at the closest 90° angle. When the fixture is not set to 'Lock to Cardinal: all the vertices of the Conforming Mesh, all the bones of the Skinned Mesh, and the Additional Mesh, will conform inwards from the centre of the fixture.
Fixture settings[edit | edit source]
- Fixture GUID - Unique identifier for this fixture.
- Family GUID - Identifier for this fixture family. Should be unique to every other family GUID, and identical to every other variant of this fixture
- Fixture Type - What category this fixture should be in (ie: headlight, aerial, grille, etc...)
- M Ghost Material - Defines the material to use when the fixture cannot be placed where the player is attempting to place it. This setting shouldn't change from its default 'FixtureError' material
unless you really want to change it.
Fixture Sub-Meshes[edit | edit source]
UV Mesh[edit | edit source]
The UV Mesh (imported as a Static Mesh in UE4) is a flat silhouette that tells the fixture to cut a hole in to the car mesh. You will only need vertices along the outside edges of the UV Mesh. An UV Mesh is only required if your fixture intends to cut in to the car.
Conforming Mesh[edit | edit source]
The Conforming Mesh (imported as a Static Mesh in UE4) is a mesh where each vertex is deformed to match the car mesh. It is also a required mesh if the fixture has an UV Mesh, as the Conforming Mesh is used to cover over the hole created by the UV Mesh. A Conforming Mesh that could logically be placed on top of other fixtures should also have its outside edges extrude in to the car (The default distance for this extrusion is slightly farther than 10cm)
Skinned Mesh[edit | edit source]
The Skinned Mesh (imported as a Skeletal Mesh in UE4) is used when you have parts of a fixture that should conform to the rough shape of the car, but also retain the dimensions and ratios of its components. A Skinned Mesh will have a bone for each element that should remain the same shape, and should be parented to the bone root. The bone location should be on Y-0 (not inside the fixture, or floating outside the front of the fixture) to allow for the proper rotation of its weighted components. All verticies of the Skinned Mesh that are further out of the car than 0.1cm will conform to the car as if they were part of a Conforming Mesh. Because of this, there will be a small gap of at least 0.1cm between the edge of the Skinned Mesh and the car body. To cover up this gap, use a Conforming Mesh to link the edge of the Skinned Mesh and the car body.
Additional Mesh[edit | edit source]
The Additional Mesh (imported as a Static Mesh in UE4) does not deform in any way and will remain in place relative to the location of the fixture. An Additional Mesh has no skin or bones, and no part of it will deform to the shape of the car. An example of an Additional Mesh is an exhaust, or the mirror section of a wing mirror.
Creating a Fixture[edit | edit source]
Note: This how-to assumes a general understanding of 3D modelling packages, and this example will be using 3DS-Max. However, any 3D modelling package that supports UV Unwraps and Skinning will do, as no custom scrips are required to author fixture sub-meshes. 3D Modelling packages that support exporting to .FBX files is ideal, but UE4 also supports .OBJ files.
Fixture Orientation[edit | edit source]Fixtures are oriented in the following manner in the 3D authoring package:
Fixture Y-Axis Thresholds[edit | edit source]
There are 3 important values to take in to note for Fixture Sub-Meshes.
- A Fixture's Skinned Mesh will have some of its vertices conform to the car as if it were a Conforming Mesh only if those vertices are farther out from the car than 0.1cm (that's lower than -0.1cm in the Y-axis - so a vertex with a Y-axis value of -0.15cm will conform to the car as if it were part of a Conforming Mesh, and a vertex with a Y-axis value of 0.05cm will not).
- Grilles go in to the car 4.301cm (that's a Y-axis value of 4.301cm). Any fixture (like a headlight) that could be feasably placed on top of a grille fixture should have all of its important mesh structure between this point and the front of the fixture.
- The outer edges of most Conforming Meshes (and inner edges of things with holes in them, like open grilles) go in to the car 10.114cm (that's a Y-axis value of 10.114cm). This stops fixtures from appearing to 'float' when put on top of other fixtures that cut in to cars and leave a gap, such as grilles.
Here's a visual representation of these values:
It's a bit confusing at first, but following these rules will ensure your fixture works correctly.
Deciding what Sub-Meshes you'll need[edit | edit source]
Fixtures have a fairly convoluted list of things that are or are not needed, depending on what is in the fixture.
- If you have an UV Mesh, you need to have a Conforming Mesh to cover the hole.
- If you have a Conforming Mesh, it isn't required to have anything else unless the Conforming Mesh goes in to the car body mesh, in which case you'll need an UV Mesh to cut out the hole for it.
- If you have a Skinned Mesh, you'll need a Conforming Mesh and an UV Mesh, as a skinned mesh can only be inside the car, therefore an UV Mesh is needed to cut out that hole and a Conforming Mesh is needed to cover the gaps created by that hole.
- If you have an Additional Mesh that floats above the car body, you don't need anything. If the Additional Mesh goes in to the car body mesh, you'll need an UV Mesh to cut out the hole for that (and by extension, a Conforming Mesh to cover that hole).
Creating the Sub-Meshes[edit | edit source]
Creating an UV Mesh[edit | edit source]texels of the car body that will be cut out by the fixture. Each vertex is used as a point of reference, and lines are drawn between them along the edges of the UV Mesh to define the final cut out shape on the car body.
Note that if there are too few vertices, then the cutout shape will become distorted, as the vertices are projected on to the car texture then cut out, and the actual edges of the UV Mesh are not used, resulting in waviness in the final cutout shape.
An UV Mesh should have vertices at regular intervals around the outside to determine the cutout shape of the fixture. Note that any vertices not on the outside edge are wasted and will only make the fixture slower to render. (UV Meshes can be made in annulus shapes, like a doughnut).
The UV Mesh should be roughly half-way between the outside edge of the Skinned Mesh (which should share its edge with the inside edge of the Conforming Mesh) and the outside edge of the Conforming Mesh.See below for an example UV Mesh, in comparison to its respective Conforming Mesh.Additional Notes for more information.
Creating a Conforming Mesh[edit | edit source]
A Conforming Mesh is a single basic polygonal mesh that conforms to the shape of the car body.
The Conforming Mesh should have enough polygons at regular intervals so that it doesn't become blocky or clip through the car body. The more polygons you add to the Conforming Mesh, the longer it will take to calculate its final morph position, but does not impact the general dragging around of the fixture.
For this example fixture, we'll be using the Conforming Mesh for two purposes:
- Connecting the Skinned Mesh to the car body.
- Covering the cutout hole created by the UV Mesh.
However, a Conforming Mesh can be used just on its own, such as:
- when creating trim pieces, bonnet humps, or badges.
- to create Grilles, when used with an UV Mesh to cut out the hole for the Grille.
Creating the Mesh[edit | edit source]We'll start by using the UV Mesh as our reference point. Our Conforming Mesh needs to cover the hole created here, so we'll make a ring of faces to surround the UV Mesh with enough width to not allow any gaps in the cutout texture on the car. We'll extrude this edge out in to the -Y axis (forward out from the car body) to stop this ring of faces from z-fighting with the car body, and we'll add a ring of faces around the outside of this to connect this set of faces to the car body like so:
Applying Material IDs[edit | edit source]
I've used 3 materials for this fixture (but any number of materials is supported): One for the paint (red) that will go around the outside of the headlight, one for the headlight glass (transparent orange), and one for the chrome interior of the headlight (yellow). It doesn't matter what colour or order in the material ID stack you make these, as we'll apply the correct materials in Unreal Engine 4.
In 3DS-Max, this is done by applying Material IDs to the faces of the mesh, and assigning a Multi-SubObject Material with Sub-Materials applied to it.
Unwraping the Mesh[edit | edit source]
The next step is to apply an Unwrap to the mesh. We'll be use 3DS-Max's default UVW Map modifier, set it to 'box' projection, and set the length, width, and height dimensions to 2,2,2. This is an important dimension if your fixture mod intends to use our default materials, as these materials assume the UVs of the fixture conform to this setting.
Basically what this is doing is mapping every face on the mesh so that the 0-1 areas of the UV Map are 2cm².If your 3D modelling package does not support a box projection with scaling options, try installing a student version of 3DS-Max from Autodesk's website.
Creating a Skinned Mesh[edit | edit source]
A Skinned Mesh is the most complicated mesh in the fixture. It follows the same rules as the Conforming Mesh in terms of overall mesh structure and UV Mapping, but the way in which it conforms to the car is more nuanced.The vertices of a Skinned Mesh will conform to the car in the same manner as the Conforming Mesh only if those vertices are further out than 0.1cm in the negative-Y axis, as shown below:
Applying Materials[edit | edit source]
As with the Conforming Mesh, assign materials to your mesh with material IDs and a multi-sub-object material.
Apply an UVW Unwrap[edit | edit source]
Assign the same Box map with a scale of 2,2,2 as you did with the conforming mesh.
Creating an Additional Mesh[edit | edit source]
An Additional Mesh is made of a simple mesh with no skin or morphs that does not deform in any way. The Additional Mesh does rotate around the fixture position, and will maintain its relative position from its pivot point.Take the following example. This is an exhaust fixture. Notice that the entirety of the exhaust is offset from the pivot point - this is so this exhaust can hang under the car, as the fixture itself must be placed on the car but the exhaust in this instance must be under the car:
Fixture Mod setup within Unreal Engine 4[edit | edit source]
This step assumes that the correct version of Unreal Engine is installed and configured correctly. See Modding for more information on the correct version of Unreal Engine to use and how to view mod content folders. Also see the official Unreal Engine documentation on importing .FBX files.
Creating your Fixture Mod Plugin[edit | edit source]With the correct version of Unreal Engine opened with our modding tool project and plugins loaded, you should be able to select 'create mod' from the top menu bar (step 1). From there, select 'New Fixture' (step 2), then give your mod a name (step 3) and a description (step 4), then click 'create mod' (step 5).
Folder structure setup[edit | edit source]
This step assumes a basic understanding of the Unreal Engine Content Browser.
It is always a good idea to maintain a reasonable organisational structure. I always try to keep my fixtures in the following format:Fixtures > Category > Individual Fixture, with all of the variants of that fixture within that final 'Individual Fixture' folder. Like so:
Importing files to Unreal Engine[edit | edit source]
Mesh Importing[edit | edit source]
UV Meshes, Conforming Meshes, and Additional Meshes should be imported as 'Static meshes' ('Skeletal Mesh' is un-ticked in the import dialogue), while Skinned Meshes should be imported as 'Skeletal Meshes' '(Skeletal Mesh' is ticked in the import dialogue).Note that 'Skeletal Meshes' will import with additional 'Skeleton' and 'Physics Asset' files. These are important. You don't need to do anything with them, but don't delete them.
Assigning Default Materials and Material Slot names[edit | edit source]
Assigning Material Slot names[edit | edit source]
The new fixture material swap system in Automation relies on the name of the material slots within the mesh components to define what materials can be applied to the fixture.
Therefore, Assigning the correct materials to the meshes is only important for the initial selection and loading of that fixture. In this manner, it is possible to have custom materials applied to your fixture while still being compatible with Automation's fixture switching UI.
The fixture switching UI in Automation relies on the names of the material slots on the sub-meshes to decide what category of materials the player has to select from.
The available categories for fixture materials is:
Note that these names are case-sensitive.
If you only have a single version of a fixture material category, you still need to have a number, where '#' is replaced with a number. This number scales infinitely, meaning a fixture can have many separate panel/glass/grill slots assigned to it. A Fixture's sub-meshes cannot share the same name on its material slots. If a fixture contains meshes with duplicate slot names, they will appear incorrect in-game.Here is a headlight Conforming Mesh, with its default materials set, and the names of its material slots set to their respective types. The workflow for the Additional Mesh should be identical:
Assigning Default Materials[edit | edit source]
While the slot names define what materials the player can choose from in-game, it doesn't define what material gets first loaded when the player places the fixture on the car.
When the fixture is first placed on the car, it loads the material that is set in that fixture's sub-mesh default materials. For the sub-mesh examples above, you can see that the slot names have been set and the material slots also have materials set in them.
Therefore, for all your fixture sub-meshes, you also need to apply their default materials.
To find where all the materials available in-game are, open up the Utils blueprint, located in: Content > Utility > Utils, and open the 'Get Materials from Slot' function. There, you can view the list of each material that gets assigned in to each slot, find them in the content folder, and assign them to your mesh as the default material.
To do this, open Utils:
Then open 'Get Fixture Materials from Slot', located in Utils > Car Painting > GetFixtureMaterialsFromSlot:
From there, select the corresponding materials array for the material type you want to apply to your sub-mesh:
And in the details panel you'll see an array of the materials used for that slot type:
By expanding that, you can see the materials, and by selecting the small magnifying glass icon, view that material in the Content Browser:
and from there apply it to your sub-mesh.
Alternatively, here is a list of all the currently-used materials, and their locations in the content browser:
- M_BlackPlastic (located in: Content > Environments > BuildingInteriors > Assets > ArtTest > Materials
- M_BlackPlastic_ShinyBlack (located in: Content > Fixtures > FixtureMats
- MI_Metal_Chrome_01_Bright (located in: Content > Cars > Materials > NewMaterials > Metal
- M_Grill (located in: Content > Fixtures > FixtureMats)
- M_Grill02 (located in: Content > Fixtures > FixtureMats)
- M_Grill03 (located in: Content > Fixtures > FixtureMats)
- M_Grill04 (located in: Content > Fixtures > FixtureMats)
- M_Grill05 (located in: Content > Fixtures > FixtureMats)
- M_Grill_Trans (located in: Content > Fixtures > FixtureMats)
- M_Grill02_Trans (located in: Content > Fixtures > FixtureMats)
- M_Grill03_Trans (located in: Content > Fixtures > FixtureMats)
- M_Grill04_Trans (located in: Content > Fixtures > FixtureMats)
- M_Grill05_Trans (located in: Content > Fixtures > FixtureMats)
- M_HeadLightGlass_Clear (located in: Content > Fixtures > FixtureMats)
- TransparentMat_Inst (located in: Content > Cars > Materials > SharedMaterials)
- M_Indicator_SmoothGlass (located in: Content > Fixtures > FixtureMats)
- M_Indicator_SmoothPlastic (located in: Content > Fixtures > FixtureMats)
- M_Indicator_RoughPlastic (located in: Content > Fixtures > FixtureMats)
- M_BrakeLight_SmoothGlass (located in: Content > Fixtures > FixtureMats)
- M_BrakeLight_SmoothPlastic (located in: Content > Fixtures > FixtureMats)
- M_BrakeLight_RoughPlastic (located in: Content > Fixtures > FixtureMats)
- M_ReversingLight_SmoothGlass (located in: Content > Fixtures > FixtureMats)
- M_ReversingLight_SmoothPlastic (located in: Content > Fixtures > FixtureMats)
- M_ReversingLight_RoughPlastic (located in: Content > Fixtures > FixtureMats)
- Opaque Glass:
- Round Glass:
Creating the Fixture Blueprint[edit | edit source]
If your Fixture Mod only contains one fixture with no variants, you may skip this step, as the 'Creating your Fixture Mod Plugin' step should have created a fixture blueprint in your mod folder for you (unless you did not start your mod with the mod type of 'fixture mod', then please continue).When creating a new fixture, you will need to either duplicate a blueprint from another fixture (the first fixture blueprint created by 'Creating your Fixture Mod Plugin' will work for this), or create a child blueprint from A_Fixture (located in Content/Cars/Blueprints/Fixtures) by right-clicking on it and selecting 'Create Child Blueprint Class'. The Fixture Blueprint then needs to be moved to the fixture's sub-folder location.
Assigning settings within the Fixture Blueprint[edit | edit source]Open the Fixture Blueprint. You should be confronted with the following:
Assigning Meshes within the Fixture Blueprint[edit | edit source]Assign your meshes to their respective slots by selecting them in the Content Browser then clicking on the small arrow in the fixture blueprint next to the associated slot, or by dragging and dropping the mesh in to the slot. You can also search for the mesh and assign it within the dialogue box.
Assign the GUIDs[edit | edit source]Generate a GUID for the fixture and the family. If this fixture is part of a family, then copy-paste the family GUID instead. The Fixture GUID should always be unique.
Adjust fixture blueprint settings[edit | edit source]
- Assign the Fixture Type
- Assign the Centre Snap Distance
- Assign the 'Lock Normal to Cardinal' setting
Consult the Fixture Mods step for further descriptions on these settings.
Compile and Save the Fixture Blueprint[edit | edit source]
Once all your sub-meshes and settings have been applied in the Fixture Blueprint, you have to compile and save that blueprint.To Compile it, press the 'Compile' button in the Fixture Blueprint (top left of the blueprint editor window).
Creating the fixture thumbnail files[edit | edit source]
The Fixture Blueprint does not get automagically loaded in to the fixture UI. The UI loads a proxy thumbnail file instead, so we need to generate this proxy file. If the Fixture Blueprint does not have an associated thumbnail, it will not show up in-game. Luckily, we have an automated script to do this.
Open the Thumbnail Generator Level[edit | edit source]Open the Thumbnail Generator Level from: 'Content > Developer Sandbox > ThumbnailGeneratorLevel'
Populate the Fixture Thumbnail Generator[edit | edit source]Select the Fixture Thumbnail Generator from the World Outliner, and add your fixture blueprint to the 'Fixtures to Generate' array (by first clicking the 'plus' icon, then putting the fixtures you have created in to the list).
Generate the Thumbnail and CPP file[edit | edit source]Select 'Export Preview' to generate the Thumbnail file and FixturePreviewCPP files. These files should be created within a 'thumbnail' folder within their respective fixture sub-folders.
Additional Notes[edit | edit source]
- Fixtures should not have any vertices along the centre axes to avoid any miscalculation by the fixture gizmo. If the gizmo fires a ray cast through the centre line of the car, it can miss the two halves of the car and give a false positive of the fixture being out of bounds. Offsetting your vertices slightly will avoid this misfire. The Additional Mesh is the sole exception to this rule, as none of the Additional Mesh is morphed in any way.
- Is CPU Access still turned on for all Static Meshes? If your mod causes a crash, this might be un-ticked. It does that sometimes. Re-tick it, and try again.