top of page
Jakob Råberg

FBX with CAD data to Unreal Engine



Task: Client want to visualize their processing machines in VR to show their customers how it will look like.


  1. Get FBX with CAD data

  2. Clean that data

  3. Export to Unreal Engine

  4. Setup VR game



  1. The cad data we got was a 1.1gb FBX file.

    So step one was to open it in Blender ( My 3D program of choice ) and split it up in smaller models, around 30 FBX files instead. I had to have the computer on all night just to be able to open the file, so it was crucial to break it down in smaller FBXs.

  2. As you can see in the outliner, just this small FBX with 10MB data has 4 000 empty's, 676 meshes and 655 materials. Wow, that's not good.

    We need to fix this before exporting to Unreal Engine.

    To optimize the workflow in Unreal I need the same material name on all meshes that's supposed to have the same material color.



  3. We fix the first problem by " clear parent " on all meshes, select all " empty's " and remove them. Now we have cleared a lot of empty data, which makes the file faster and smaller in size. Now we need another script to solve the materials.



  4. This script removes everything after the "." in the material name ( for example with this material name " AutoCAD Color Index 1.1035 " -> " AutoCAD Color Index 1. "

    So all materials that end up with the same name " AutoCAD Color Index 1. " becomes one material instead of hundreds. Next part of the script removes the "." and then takes all objects that share that name and set the same material on those objects. Then Purge the materials that's not in use ( Purge = Remove/Delete ) and cleans the material names. Thanks to Martin Lorentzon ( former class college )who helped out on the script! One thing we can't forget is to ask our colleges for help to speed up the process.



  5. Now after the scripts done we have instead, 0 emptys & 7 materials!

  6. Perfect! Now we can export to Unreal Engine and setup a script that automates the materials for all the objects.



  7. First step in Unreal Engine. Make Blueprint and write this code.

    It takes all material slot names from a static mesh, Loop through every name and if the name matches the name in the MAP ( Color Material Map ) it sets the designated material on the Slot name on the mesh. Voila! Now we sets all the material in seconds.


  8. Client also wanted to be able switch material on different objects. So the Green can turn into stainless steel and back.


  9. So lets make a Function that Get Materials from the Static Mesh, loop them through and change Material Instance ( MI ) on all materials with Slot Name " Green "

    This function will later be controlled by a button in the UI.


  10. Now we have automated the process in Unreal Engine. Now we just make Child Blueprints and choose Static Meshes and watch the magic work.


20 views0 comments

Recent Posts

See All

Comentários


bottom of page