Rim Mods: Difference between revisions

From Automation Game Wiki
imported>Therealhardrooster
 
Line 9: Line 9:


Essentially, a Morph-Targeted mesh has a base mesh (the default state of that mesh), and a separate mesh for each state that the mesh can be in.<blockquote>'''This means that the base mesh and each of the morph targets must have the same vertices, faces, and edges.'''</blockquote>So plan ahead, and be ready to re-do all your work again, and again, and again... when 3DS-Max decides to add vertices somewhere for no apparent reason, or you've run in to a situation when creating your morphs that requires a different mesh flow:
Essentially, a Morph-Targeted mesh has a base mesh (the default state of that mesh), and a separate mesh for each state that the mesh can be in.<blockquote>'''This means that the base mesh and each of the morph targets must have the same vertices, faces, and edges.'''</blockquote>So plan ahead, and be ready to re-do all your work again, and again, and again... when 3DS-Max decides to add vertices somewhere for no apparent reason, or you've run in to a situation when creating your morphs that requires a different mesh flow:
[[File:3DS-Max Fuckery 01.jpg|alt=Make sure to always have the XView Statistics open in 3DS-Max (or its equivelant in your modelling package) to ensure you haven't managed to create additional verticies when making your morph targets.|none|thumb|Make sure to always have the XView Statistics open in 3DS-Max (or its equivelant in your modelling package) to ensure you haven't managed to create additional verticies when making your morph targets.]]
[[index.php?title=File:3DS-Max_Fuckery_01.jpg|alt=Make sure to always have the XView Statistics open in 3DS-Max (or its equivelant in your modelling package) to ensure you haven't managed to create additional verticies when making your morph targets.|frameless]]
If, upon completion of a morph target, your mesh does this:
If, upon completion of a morph target, your mesh does this:
[[File:Morph Borks.gif|alt=If this happens, you've added/subtracted some verts from your morph targets.|none|thumb|If this happens, you've added/subtracted some verts from your morph targets.]]
[[index.php?title=File:Morph_Borks.gif|alt=If this happens, you've added/subtracted some verts from your morph targets.|frameless]]
...Then you've got a messed up vert structure and you're going to have to re-do all your morph targets again.  If you can't even select a mesh to be a morph target, then you've added some vertices somewhere and will still have to re-do all your morph targets again.
...Then you've got a messed up vert structure and you're going to have to re-do all your morph targets again.  If you can't even select a mesh to be a morph target, then you've added some vertices somewhere and will still have to re-do all your morph targets again.


Line 31: Line 31:


A good alternative to separating all your edges in to separate elements is to simply chamfer everything to have a slight curve to it.  This also helps make the Rim look cleaner:
A good alternative to separating all your edges in to separate elements is to simply chamfer everything to have a slight curve to it.  This also helps make the Rim look cleaner:
[[File:Edge Chamfer 01.jpg|alt=I've chamfered the edges of this Rim to avoid having to cut its smoothing groups in to different elements|none|thumb|I've chamfered the edges of this Rim to avoid having to cut its smoothing groups in to different elements]]
 
[[index.php?title=File:Edge_Chamfer_01.jpg|alt=I've chamfered the edges of this Rim to avoid having to cut its smoothing groups in to different elements|frameless]]


=== How Morph Targets are Used for Rims ===
=== How Morph Targets are Used for Rims ===
Line 47: Line 48:


As an example, here's the base mesh for a rim:
As an example, here's the base mesh for a rim:
[[File:Base Mesh Example 02.jpg|none|thumb|alt=Rim Base Mesh|Rim Base Mesh]]
 
[[index.php?title=File:Base_Mesh_Example_02.jpg|alt=Rim Base Mesh|frameless]]


its Scale Morph:
its Scale Morph:
[[File:Base Mesh Scale Morph Example 02.jpg|none|thumb|alt=Rim Scale Morph|Rim Scale Morph]]
 
[[index.php?title=File:Base_Mesh_Scale_Morph_Example_02.jpg|alt=Rim Scale Morph|frameless]]
 
And its Offset Morph:
And its Offset Morph:
[[File:Base Mesh Offset Morph Example 02.jpg|none|thumb|alt=Rim Offset Morph|Rim Offset Morph]]
 
[[index.php?title=File:Base_Mesh_Offset_Morph_Example_02.jpg|alt=Rim Offset Morph|frameless]]


== Creating the Morph-Targeted Skeletal Mesh ==
== Creating the Morph-Targeted Skeletal Mesh ==
Line 67: Line 72:
* '''Offset distance''': -12.597cm
* '''Offset distance''': -12.597cm
Note the below screenshot for a visual representation of these dimensions:
Note the below screenshot for a visual representation of these dimensions:
[[File:Rims are complicated and I'm sorry.png|alt=Orange: an existing Rim.  Pink: Our currently created example rim with an outer radius of 13cm and a depth of 5.7225cm  White/Blue: The inner radius of the Rim (5.88), where it will connect to the axle and brakes|none|thumb|Orange: an existing Rim.
Pink: Our currently created example rim with an outer radius of 13cm and a depth of 5.7225cm


White/Blue: The inner radius of the Rim (5.88), where it will connect to the axle and brakes
[[index.php?title=File:Rims_are_complicated_and_I'm_sorry.png|alt=Orange: an existing Rim.  Pink: Our currently created example rim with an outer radius of 13cm and a depth of 5.7225cm  White/Blue: The inner radius of the Rim (5.88), where it will connect to the axle and brakes|frameless]]
]]


==== Rim Orientation ====
==== Rim Orientation ====
[[File:Fixture Orientation Example 01.jpg|alt=Rims face towards the -X axis, with +Z being up|none|thumb|Rims face towards the -X axis, with +Z being up]]
[[index.php?title=File:Fixture_Orientation_Example_01.jpg|alt=Rims face towards the -X axis, with +Z being up|frameless]]


=== Rim Position ===
=== Rim Position ===
Line 85: Line 87:
==== Base Mesh format and scale ====
==== Base Mesh format and scale ====
I have created a cylinder and set it to the default dimensions.  I've also added a number of sides (I find that sides >100 give a good result. The more the merrier, but to make life easier I find it better to make the number of edges for the Rim be a multiple of the number of spokes for that Rim):
I have created a cylinder and set it to the default dimensions.  I've also added a number of sides (I find that sides >100 give a good result. The more the merrier, but to make life easier I find it better to make the number of edges for the Rim be a multiple of the number of spokes for that Rim):
[[File:Example Rim Step 01.jpg|none|thumb]]
 
[[File:I dont even know why i bother naming these.jpg|alt=Close-up of the cylinder properties|none|thumb|Close-up of the cylinder properties]]
[[index.php?title=File:Example_Rim_Step_01.jpg|frameless]][[index.php?title=File:I_dont_even_know_why_i_bother_naming_these.jpg|alt=Close-up of the cylinder properties|frameless]]
 
Note that the yellow mesh has a small lip on its outside edge, making it appear to not be wide enough.  Here is that rim from the front:
Note that the yellow mesh has a small lip on its outside edge, making it appear to not be wide enough.  Here is that rim from the front:
[[File:Example rim 04.jpg|none|thumb]]
 
[[index.php?title=File:Example_rim_04.jpg|frameless]]


==== Creating the rest of the Base Mesh ====
==== Creating the rest of the Base Mesh ====
Go through the process of creating your Rim Base Mesh.  A lot of this is going to be specific to the design you're going for, but keep in mind that this is the same mesh structure that you're going to need to scale out for the Scale Morph and the Offset Morph, so creating enough connecting edges is important.  This Rim will scale out relatively simply, but I'm going to give it a subtle curve to its offset morph, so I've given it some extra edges along the spokes.
Go through the process of creating your Rim Base Mesh.  A lot of this is going to be specific to the design you're going for, but keep in mind that this is the same mesh structure that you're going to need to scale out for the Scale Morph and the Offset Morph, so creating enough connecting edges is important.  This Rim will scale out relatively simply, but I'm going to give it a subtle curve to its offset morph, so I've given it some extra edges along the spokes.
[[File:Base mesh poly structure.jpg|alt=Not here that for this Rim I've created several edge loops along the spokes of the Rim to aid in the transition for these morphs.|none|thumb|Not here that for this Rim I've created several edge loops along the spokes of the Rim to aid in the transition for these morphs.]]Fixing Smoothing Group problems with .FBX and Morphers
 
[[index.php?title=File:Base_mesh_poly_structure.jpg|alt=Not here that for this Rim I've created several edge loops along the spokes of the Rim to aid in the transition for these morphs.|frameless]]
 
Fixing Smoothing Group problems with .FBX and Morphers


So you've set up your mesh and assigned smoothing groups to it, but you remember that I mentioned earlier that Smoothing Groups don't work with Morph Targets.  How do you go about fixing that?  Consult [[Rim Mods#Morph Targets, Smoothing Groups, the .FBX File Format, and the complications that lie therein|This Section on Smoothing Groups and the .FBX File Format]] again for solutions to this.
So you've set up your mesh and assigned smoothing groups to it, but you remember that I mentioned earlier that Smoothing Groups don't work with Morph Targets.  How do you go about fixing that?  Consult [[Rim Mods#Morph Targets, Smoothing Groups, the .FBX File Format, and the complications that lie therein|This Section on Smoothing Groups and the .FBX File Format]] again for solutions to this.
Line 100: Line 107:


Create a multi-sub-object material with two standard materials in it, and apply it to your mesh.
Create a multi-sub-object material with two standard materials in it, and apply it to your mesh.
[[File:Multi sub object material.jpg|none|thumb]]
 
[[index.php?title=File:Multi_sub_object_material.jpg|frameless]]
 
then simply set your material IDs on your mesh to either 1 or 2.
then simply set your material IDs on your mesh to either 1 or 2.


Line 110: Line 119:


'''Make sure you have your XView Statistics (or its equivalent for your authoring package) open and ready to check for anomalies.'''
'''Make sure you have your XView Statistics (or its equivalent for your authoring package) open and ready to check for anomalies.'''
[[File:Xview statistics.jpg|alt=cry.jpg|none|thumb|If, at any point and for any reason when creating your Morph Targets, these numbers change: scrap what you're doing and re-start the Morph Target]]
 
[[index.php?title=File:Xview_statistics.jpg|alt=cry.jpg|frameless]]


===== Creating the Scale Morph Target =====
===== Creating the Scale Morph Target =====
Line 120: Line 130:


The outside edges of your Scale morph should then look something like this:
The outside edges of your Scale morph should then look something like this:
[[File:Scale morph example.jpg|none|thumb|Orange:  Our new Scale morph
 
White:  Our existing Base Mesh
[[index.php?title=File:Scale_morph_example.jpg|frameless]][[index.php?title=File:Scale_Mesh_Perspective_View.jpg|alt=The same Scale morph compared to its Base Mesh, in perspective view|frameless]]
]]
 
[[File:Scale Mesh Perspective View.jpg|alt=The same Scale morph compared to its Base Mesh, in perspective view|none|thumb|The same Scale morph compared to its Base Mesh]]
Other than the outside edges scaling out, and the edges connecting to the axle, you have full creative freedom in creating your Scale morph.
Other than the outside edges scaling out, and the edges connecting to the axle, you have full creative freedom in creating your Scale morph.


Line 134: Line 143:


That means that the outermost edges of the Offset morph will be like so:
That means that the outermost edges of the Offset morph will be like so:
[[File:Rim offset example 02.png|none|thumb]]
 
[[index.php?title=File:Rim_offset_example_02.png|frameless]]


Here is an Offset morph compared to its Base Mesh:
Here is an Offset morph compared to its Base Mesh:
[[File:Offset mesh example.jpg|none|thumb]]
 
[[index.php?title=File:Offset_mesh_example.jpg|frameless]]
 
These are some pretty nonsense numbers!
These are some pretty nonsense numbers!


Line 145: Line 157:


== Assigning the Morph Targets to the Base Mesh ==
== Assigning the Morph Targets to the Base Mesh ==
[[File:Assigning Morph Targets.jpg|none|thumb]]
[[index.php?title=File:Assigning_Morph_Targets.jpg|frameless]]
Create a Morpher modifier to your Base Mesh, and assign the Morphs in this order:
Create a Morpher modifier to your Base Mesh, and assign the Morphs in this order:
* Scale Morph (this morph mesh should have '_SCALE' at the end of its name, case sensitive and without the quotation marks)
* Scale Morph (this morph mesh should have '_SCALE' at the end of its name, case sensitive and without the quotation marks)
Line 155: Line 167:
== Export your Rim Mesh to .FBX ==
== Export your Rim Mesh to .FBX ==
Select your Base Mesh with the Morpher modifier and two morph targets on it. ''Do not select the Scale morph or the Offset morph.''
Select your Base Mesh with the Morpher modifier and two morph targets on it. ''Do not select the Scale morph or the Offset morph.''
[[File:Selecting your mesh for export.gif|none|thumb]]
 
[[index.php?title=File:Selecting_your_mesh_for_export.gif|frameless]]
 
Select File > Export Selected, and export your Rim as .FBX
Select File > Export Selected, and export your Rim as .FBX
[[File:Export rim dialogue.gif|alt=Make sure Smoothing Groups and Morphs are ticked for export, even though Smoothing Groups don't work for Morph Targets - UE4 still uses them for things.|none|thumb|Make sure Smoothing Groups and Morphs are ticked for export, even though Smoothing Groups don't work for Morph Targets - UE4 still uses them for things.]]
 
[[index.php?title=File:Export_rim_dialogue.gif|alt=Make sure Smoothing Groups and Morphs are ticked for export, even though Smoothing Groups don't work for Morph Targets - UE4 still uses them for things.|frameless]]
 
Your Morph-Targeted mesh is now complete, and you can move on to setting it up in the Unreal Engine!
Your Morph-Targeted mesh is now complete, and you can move on to setting it up in the Unreal Engine!


Line 163: Line 179:


=== Creating your Rim Mod plugin ===
=== Creating your Rim Mod plugin ===
[[File:Create rim blueprint.gif|none|thumb]]
[[index.php?title=File:Create_rim_blueprint.gif|frameless]]
Create a new blank mod.
Create a new blank mod.


Navigate to ''Content/Cars/Wheels/Rims'', and make a Child Blueprint of '''Rim,''' and move that child to your Rim Mod folder.
Navigate to ''Content/Cars/Wheels/Rims'', and make a Child Blueprint of '''Rim,''' and move that child to your Rim Mod folder.
[[File:Create child bp class.jpg|none|thumb]]
 
[[index.php?title=File:Create_child_bp_class.jpg|frameless]]


=== Importing your Rim mesh ===
=== Importing your Rim mesh ===
Import your Rim.FBX file to your Mod Content folder.  Make sure the .FBX is imported as a Skeletal Mesh, with 'Import Morph Targets' turned on.
Import your Rim.FBX file to your Mod Content folder.  Make sure the .FBX is imported as a Skeletal Mesh, with 'Import Morph Targets' turned on.
[[File:Rim Import Settings.gif|none|thumb|The Rim mesh should be imported as a Skeletal Mesh, with 'Import Morph Targets' turned on.]]
 
[[index.php?title=File:Rim_Import_Settings.gif|frameless]]
 
Your Mod folder should now look something like this:
Your Mod folder should now look something like this:
[[File:Rim folder and file structure.jpg|none|thumb]]
 
[[index.php?title=File:Rim_folder_and_file_structure.jpg|frameless]]


=== Setting up the Rim Blueprint ===
=== Setting up the Rim Blueprint ===


==== The Rim Blueprint and its Components ====
==== The Rim Blueprint and its Components ====
Rim Blueprints are relatively simple:[[File:Example Blank Rim BP.jpg|alt=A blank Rim Blueprint with only the relevant settings exposed|none|thumb|A blank Rim Blueprint with only the relevant settings exposed]]
 
Rim Blueprints are relatively simple:
[[index.php?title=File:Example_Blank_Rim_BP.jpg|alt=A blank Rim Blueprint with only the relevant settings exposed|frameless]]
* The '''Skeletal Mesh''' setting is where the rim mesh is set.
* The '''Skeletal Mesh''' setting is where the rim mesh is set.
* The '''GUID''' is an unique identifier for the rim.
* The '''GUID''' is an unique identifier for the rim.
Line 184: Line 206:
==== Assigning everything in the Rim Blueprint ====
==== Assigning everything in the Rim Blueprint ====
Assign the Skeletal Mesh to the Blueprint and generate an unique GUID:
Assign the Skeletal Mesh to the Blueprint and generate an unique GUID:
[[File:FuckingWorkThisTimePlease.gif|none|thumb]]
 
[[index.php?title=File:FuckingWorkThisTimePlease.gif|frameless]]
 
After doing so, you'll notice a 'Material' setting appear.
After doing so, you'll notice a 'Material' setting appear.


Line 199: Line 223:


*Step 1:  Open up your Rim asset;
*Step 1:  Open up your Rim asset;
 
[[index.php?title=File:NewRimStep1.png|frameless]]
[[File:NewRimStep1.png|none|thumb|Step 1]]
 
*Step 2: Scroll Down until you find the physics asset section;
*Step 2: Scroll Down until you find the physics asset section;
 
[[index.php?title=File:NewRimStep2.png|frameless]]
[[File:NewRimStep2.png|none|thumb|Step 2]]
 
*Step 3: type "rim" into the search field, it should find the "RimPhysicsAsset".  Assign that to the physics asset slot;
*Step 3: type "rim" into the search field, it should find the "RimPhysicsAsset".  Assign that to the physics asset slot;
 
[[index.php?title=File:NewRimStep3.png|frameless]]
[[File:NewRimStep3.png|none|thumb|Step 3]]


That's all the new steps, from there just continue on as usual.
That's all the new steps, from there just continue on as usual.
Line 214: Line 233:
==== Saving and Compiling ====
==== Saving and Compiling ====
Compile and Save your Rim blueprint and meshes:
Compile and Save your Rim blueprint and meshes:
[[File:Compile rim bp.gif|none|thumb]]
 
[[File:Rim save your files.gif|none|thumb]]
[[index.php?title=File:Compile_rim_bp.gif|frameless]][[index.php?title=File:Rim_save_your_files.gif|frameless]]


=== Generating the Rim Thumbnail ===
=== Generating the Rim Thumbnail ===
Line 221: Line 240:


Open the Thumbnail Generator Level, from Content > DeveloperSandBox > ThumbnailGeneratorLevel
Open the Thumbnail Generator Level, from Content > DeveloperSandBox > ThumbnailGeneratorLevel
[[File:Open thumb gen level.gif|none|thumb]]
 
[[index.php?title=File:Open_thumb_gen_level.gif|frameless]]
 
Start simulating the level
Start simulating the level
[[File:Simulate the level.jpg|none|thumb]]
 
[[index.php?title=File:Simulate_the_level.jpg|frameless]]


Then select the A_Fixture_Thumbnail_Generator from the World Outliner, and assign your newly created Rim(s) to the 'Rims to Generate' array
Then select the A_Fixture_Thumbnail_Generator from the World Outliner, and assign your newly created Rim(s) to the 'Rims to Generate' array
[[File:Rim thumb gen.gif|none|thumb]]
 
[[index.php?title=File:Rim_thumb_gen.gif|frameless]]
 
Fimally, click 'Generate Wheel Thumbnails' to generate the thumbnail files
Fimally, click 'Generate Wheel Thumbnails' to generate the thumbnail files
[[File:Generate rim thumb.gif|none|thumb]]
 
[[index.php?title=File:Generate_rim_thumb.gif|frameless]]
 
You should now have a folder in your Rim folder called 'thumbnails'.
You should now have a folder in your Rim folder called 'thumbnails'.


Open that folder, and the folder within, and save the newly created Thumbnail and CPP file:
Open that folder, and the folder within, and save the newly created Thumbnail and CPP file:
[[File:Save thumbs.jpg|none|thumb]]
 
[[index.php?title=File:Save_thumbs.jpg|frameless]]
 
Your Rim Mod is now all set up!
Your Rim Mod is now all set up!

Revision as of 20:37, 29 January 2023

Fast Rundown

  • Rims are Child Blueprint Classes of the base class 'Rim'
  • Rims are composed of a single Morph-targeted Skeletal Mesh with two morph targets
  • Rims can have one or two materials
  • Need a Preview Thumbnail to show up at all in-game

How Morph Targets work

A Morph Targeted mesh is a mesh with certain baked states for the position of each of its vertices.

Essentially, a Morph-Targeted mesh has a base mesh (the default state of that mesh), and a separate mesh for each state that the mesh can be in.

This means that the base mesh and each of the morph targets must have the same vertices, faces, and edges.

So plan ahead, and be ready to re-do all your work again, and again, and again... when 3DS-Max decides to add vertices somewhere for no apparent reason, or you've run in to a situation when creating your morphs that requires a different mesh flow:

alt=Make sure to always have the XView Statistics open in 3DS-Max (or its equivelant in your modelling package) to ensure you haven't managed to create additional verticies when making your morph targets.|frameless If, upon completion of a morph target, your mesh does this: alt=If this happens, you've added/subtracted some verts from your morph targets.|frameless ...Then you've got a messed up vert structure and you're going to have to re-do all your morph targets again. If you can't even select a mesh to be a morph target, then you've added some vertices somewhere and will still have to re-do all your morph targets again.

Morph Targets, Smoothing Groups, the .FBX File Format, and the complications that lie therein

Smoothing Groups define groups of faces that share smooth edges. For edges that should be hard, the faces on either half of that edge should be in different smoothing groups. For more information, see the official 3DS-Max documentation on Smoothing Groups.

Smoothing Groups and Morph Targets

Unfortunately, Smoothing Groups don't work for Morph Targets.

Well, they do. But only within the authoring software. The issue is with the .FBX file format that we use as an intermediary format between 3DS-Max and UE4.

.FBX files don't actually have support in the file format itself for supporting smoothing groups for the morph targets. Smoothing Groups for the base mesh does work, but as you start to move towards the morph targets, the smoothing groups start to disappear, and you end up with a mesh with really mushy looking edges as everything becomes part of the same Smoothing Group.

How do we go about solving this gaping hole in .FBX files?

Physically break apart your Smoothing Groups!

  • Mesh has a hard edge? Cut it.
  • Faces should be part of a Smoothing Group? They're now in a separate element.

It's a pain, and sometimes 3DS-Max will forget to create the new vertices for the separated edges and you'll run in to the issue stated in the How Morph Targets Work step, but it's the best solution there is as of yet.

A good alternative to separating all your edges in to separate elements is to simply chamfer everything to have a slight curve to it. This also helps make the Rim look cleaner:

alt=I've chamfered the edges of this Rim to avoid having to cut its smoothing groups in to different elements|frameless

How Morph Targets are Used for Rims

We use morph targets for defining the radius of the rim, and the offset of the rim.

  • The Base mesh is the lowest offset and smallest radius.
  • The Rim Scale is the largest radius of the Rim.
  • The Rim Offset is the farthest out the Rim gets.

What Morph Targets do I need?

For Rims, we have two Morph Targets, plus the base mesh to be morphed:

  • Default Rim
  • Rim Scale
  • Rim Offset

A Rim starts off at its smallest scale and smallest offset. So the Scale morph-target will scale it out in the Y/Z axis, and the Offset morph-target will scale it out in to the -X axis

As an example, here's the base mesh for a rim:

alt=Rim Base Mesh|frameless

its Scale Morph:

alt=Rim Scale Morph|frameless

And its Offset Morph:

alt=Rim Offset Morph|frameless

Creating the Morph-Targeted Skeletal Mesh

We'll be using 3DS-Max for this example, but any 3D Modelling package that supports Morph Targets will work as Rims do not require any custom scripts.

Rim Default Dimensions

Because of the translation between Kee engine and UE4 plus the translation between Metric and Imperial, Rims have strange and specific default dimensions. They are as follows:

  • Outer radius: 13cm
  • Inner radius (axle end): 5.88cm
  • Outer Rim thickness: 5.7225cm
  • Outer Rim inner edge distance from X-axis: 3.109cm
  • Outer Rim outer edge distance from X-axis: 2.614cm
  • Scale morph radius: 37cm
  • Offset distance: -12.597cm

Note the below screenshot for a visual representation of these dimensions:

alt=Orange: an existing Rim. Pink: Our currently created example rim with an outer radius of 13cm and a depth of 5.7225cm White/Blue: The inner radius of the Rim (5.88), where it will connect to the axle and brakes|frameless

Rim Orientation

alt=Rims face towards the -X axis, with +Z being up|frameless

Rim Position

A Rim's centre point (the point at which it connects to the rest of the wheel/axle) is 0.561,0,0. (that's 0.561cm in the X-axis, and 0 in the Y/Z axes)

Please don't judge us too hard on these numbers - the uncertainty and finickiness of morph targets combined with a translation between metric and imperial units precludes any sanity

Creating the Base Mesh

Base Mesh format and scale

I have created a cylinder and set it to the default dimensions. I've also added a number of sides (I find that sides >100 give a good result. The more the merrier, but to make life easier I find it better to make the number of edges for the Rim be a multiple of the number of spokes for that Rim):

framelessalt=Close-up of the cylinder properties|frameless

Note that the yellow mesh has a small lip on its outside edge, making it appear to not be wide enough. Here is that rim from the front:

frameless

Creating the rest of the Base Mesh

Go through the process of creating your Rim Base Mesh. A lot of this is going to be specific to the design you're going for, but keep in mind that this is the same mesh structure that you're going to need to scale out for the Scale Morph and the Offset Morph, so creating enough connecting edges is important. This Rim will scale out relatively simply, but I'm going to give it a subtle curve to its offset morph, so I've given it some extra edges along the spokes.

alt=Not here that for this Rim I've created several edge loops along the spokes of the Rim to aid in the transition for these morphs.|frameless

Fixing Smoothing Group problems with .FBX and Morphers

So you've set up your mesh and assigned smoothing groups to it, but you remember that I mentioned earlier that Smoothing Groups don't work with Morph Targets. How do you go about fixing that? Consult This Section on Smoothing Groups and the .FBX File Format again for solutions to this.

Setting Material IDs

Rims support either one or two materials.

Create a multi-sub-object material with two standard materials in it, and apply it to your mesh.

frameless

then simply set your material IDs on your mesh to either 1 or 2.

UV Mapping your Base Mesh

The same process as with creating Fixture Mods works the same here. A Box UVW Map with a scale of 2,2,2 will do fine.

Creating The Morph Targets

It's important that you do not edit the actual mesh structure of your morph targets. If I have not made this clear enough, you will break everything if you add/subtract any geometry beyond this point.

Make sure you have your XView Statistics (or its equivalent for your authoring package) open and ready to check for anomalies.

alt=cry.jpg|frameless

Creating the Scale Morph Target

Duplicate your Base Mesh. This duplicate mesh will become your Scale morph target.

A Scale morph target extends out to a radius of 37cm.

For sanity's sake, I usually only scale out the outermost vertices of my mesh first, then scale out the interior of the Scale morph appropriately. For this Rim, the spokes should maintain their parallel-ness, but get slightly thicker for the Scale morph. If I were to simply scale these out with the scale tool, they would lose this property as the outside edges got thicker but the edges closer to the centre of the rim would not, so I will move these edges out manually.

The outside edges of your Scale morph should then look something like this:

framelessalt=The same Scale morph compared to its Base Mesh, in perspective view|frameless

Other than the outside edges scaling out, and the edges connecting to the axle, you have full creative freedom in creating your Scale morph.

Creating the Offset Morph Target

As per the previous step, duplicate your Base Mesh. This duplicate mesh will become your Offset morph target.

An Offset morph will shift the outermost edges of your Rim (the parts of the Rim that lie on the 13cm radius that connect to the rest of the wheel) by -12.597cm in the X-axis.

The vertices that lie on the innermost radius (the ones at 0.561 on the X-axis that connect to the axle) should not move.

That means that the outermost edges of the Offset morph will be like so:

frameless

Here is an Offset morph compared to its Base Mesh:

frameless

These are some pretty nonsense numbers!

I find it helpful to keep an existing Rim in my scene and just snap my vertices to it for the offset instead of putting these numbers in manually. Unfortunately, unless you already have an existing Rim, this isn't helpful. But: it might be helpful to create a dummy mesh and set some of its vertices to these X-offset values to use as your snap vertices.

Other than the outside edges of the Offset morph, you have full creative freedom in creating your offset morph.

Assigning the Morph Targets to the Base Mesh

frameless Create a Morpher modifier to your Base Mesh, and assign the Morphs in this order:

  • Scale Morph (this morph mesh should have '_SCALE' at the end of its name, case sensitive and without the quotation marks)
  • Offset Morph (this morph mesh should have '_OFFSET' at the end of its name, case sensitive and without the quotation marks)

If you cannot select the morph targets, see here.

Mess about with the morph target settings to make sure your morph targets are set up correctly.

Export your Rim Mesh to .FBX

Select your Base Mesh with the Morpher modifier and two morph targets on it. Do not select the Scale morph or the Offset morph.

frameless

Select File > Export Selected, and export your Rim as .FBX

alt=Make sure Smoothing Groups and Morphs are ticked for export, even though Smoothing Groups don't work for Morph Targets - UE4 still uses them for things.|frameless

Your Morph-Targeted mesh is now complete, and you can move on to setting it up in the Unreal Engine!

Rim Mod setup within Unreal Engine

Creating your Rim Mod plugin

frameless Create a new blank mod.

Navigate to Content/Cars/Wheels/Rims, and make a Child Blueprint of Rim, and move that child to your Rim Mod folder.

frameless

Importing your Rim mesh

Import your Rim.FBX file to your Mod Content folder. Make sure the .FBX is imported as a Skeletal Mesh, with 'Import Morph Targets' turned on.

frameless

Your Mod folder should now look something like this:

frameless

Setting up the Rim Blueprint

The Rim Blueprint and its Components

Rim Blueprints are relatively simple: alt=A blank Rim Blueprint with only the relevant settings exposed|frameless

  • The Skeletal Mesh setting is where the rim mesh is set.
  • The GUID is an unique identifier for the rim.

Assigning everything in the Rim Blueprint

Assign the Skeletal Mesh to the Blueprint and generate an unique GUID:

frameless

After doing so, you'll notice a 'Material' setting appear.

This is where you'll set the placeholder materials for your Rim.

There are:

Wheel_Primary (the main colour for the rim)

Wheel_Secondary (the optional secondary colour for the rim)

New Step for 4.21.2

You now must assign a rim physics asset, otherwise you'll get a compiler error when you go to compile your blueprint.

  • Step 1: Open up your Rim asset;

frameless

  • Step 2: Scroll Down until you find the physics asset section;

frameless

  • Step 3: type "rim" into the search field, it should find the "RimPhysicsAsset". Assign that to the physics asset slot;

frameless

That's all the new steps, from there just continue on as usual.

Saving and Compiling

Compile and Save your Rim blueprint and meshes:

framelessframeless

Generating the Rim Thumbnail

NOTE: Some of the steps below are different since 4.21.2. You still open up the Thumbnail generator level, however you no longer use A_Fixture_Thumbnail_Generator. There is now a specific Wheel generator scene you'll need to use.

Open the Thumbnail Generator Level, from Content > DeveloperSandBox > ThumbnailGeneratorLevel

frameless

Start simulating the level

frameless

Then select the A_Fixture_Thumbnail_Generator from the World Outliner, and assign your newly created Rim(s) to the 'Rims to Generate' array

frameless

Fimally, click 'Generate Wheel Thumbnails' to generate the thumbnail files

frameless

You should now have a folder in your Rim folder called 'thumbnails'.

Open that folder, and the folder within, and save the newly created Thumbnail and CPP file:

frameless

Your Rim Mod is now all set up!