This tool automates the process of assigning physical materials to your Unreal Engine materials based on a dictionary of physical materials and their synonyms. It saves time and reduces the repetitive task of manually assigning physical materials to objects in your level.
Physical materials in Unreal Engine define how an object interacts with the world physically. They affect various behaviors, such as:
- Visual effects like bullet hole decals
- Ballistics modeling (e.g., effects when an object is shot)
- Interaction sounds (e.g., footsteps, impacts)
To learn more about physical materials in Unreal Engine, visit the official Unreal Engine Documentation.
- Automatically assigns physical materials to materials on existing meshes within your level.
- Uses a dictionary (key-value pairs) stored in a
.jsonfile to map material names to their corresponding physical materials. - Simple and flexible—requires only descriptive material names to function properly.
- A PyQt-based tool, DictEditor.exe, makes it easy to create and edit the dictionary of physical materials.
- Includes an Editor Utility Blueprint (EUB) with buttons to automatically assign and remove physical materials.
-
Configure the Tool:
To get started, you’ll need to specify the path to your physical materials directory and the.jsonfile containing the material mappings. By default, the.jsonfile should reside in the same folder as the script (AssignPhysMats.py). -
Dictionary Setup:
Use the DictEditor.exe tool to create and manage the dictionary of physical materials and their associated material names. The dictionary file should follow this format:- Key: Physical material name (e.g.,
Metal,Wood,Concrete). - Value: Material names that correspond to the physical material.

Once you're done, save the
.jsonfile as "material_mapping.json" - Key: Physical material name (e.g.,
-
Run the Editor Utility Widget
-
Assigning Physical Materials:
Open your level in Unreal Engine, click on the "Auto Physical Materials" button in the EUW. The script will automatically assign the appropriate physical material to each material in the level based on the dictionary. -
Removing Physical Materials:
To remove the assigned physical materials, select the materials in the content browser and click on the "Remove Physical Materials" button.
Here’s an example of the tool in action:
-
Before:
The materials in the level have no physical materials assigned:
-
Physical Materials Directory:
The physical materials reside in the/content/PhysicalMaterialsdirectory:
-
Auto Assignment:
After clicking the "Auto Physical Materials" button, the script processes the materials and assigns the correct physical materials. The output log will display the results:One rock material was wrongly assigned the
Metalphysical material:
The word Iron exists in the material name, so the script couldn't determine which physical material to assign.
- Naming Convention: The script relies on the material names being descriptive and follows a specific convention. If your material name contains ambiguous keywords (e.g., "Iron" for both metal and stone-like materials), the script may not assign the correct physical material. This may require a more careful naming strategy or manual adjustments.
- UE4 Only: This script is currently supported for Unreal Engine 4 (UE4). An update for Unreal Engine 5 (UE5) is planned.
- Not Foolproof: The tool works well for most cases but may not be perfect for all project setups. It's designed to save time and handle 80% of the assignment process.
- Physical Materials Directory: Ensure the physical materials are placed in the correct directory (
/content/PhysicalMaterialsby default). - Editing Dictionary: You can easily edit the
.jsondictionary at any time to add new mappings or adjust existing ones. - Customizing Paths: The paths to the physical materials directory and dictionary file are customizable within the script. Make sure to adjust them based on your project structure.
- Unreal Engine 4
- Enable Editor Scripting Utilities in Plugins.
- Enable Python in Unreal (for running the
AssignPhysMats.pyscript) - Optional: PyQt (for running DictEditor.py. Not needed for DictEditor.exe)
This tool is open source and free to use for both personal and commercial projects. If you find it useful, feel free to contribute or modify it for your own needs.



