Revit to Unity

One of my first paying gigs with 3D computer graphics was an architectural rendering.   It took hundreds of processing hours and resulted in a minute or so of 320×240 video.   It was blocky and cartoonish, but it was done on a computer.   A few years later we could get a 3D model of some real world structure into an immersive VR environment after weeks of works.   It required someone by hand rebuilding the model into something that could be read by the visualization software.  This assumes you first didn’t have to write the software to visualize the model.

Cycle after cycle, over the years. the formats used by drawing and the formats read by graphics engines have gotten closer together.

Revit is popular these days for building design.  Unity is popular, or at least I like it a lot because I can take it in so many directions.   Since the C4 was installed in the basement I’ve been wanting to find a way to get Revit projects into an immersive VR.    It’s been no sweat to go from 3DS or Maya into VR (through Unity or Unreal) for some time.   Getting geometry into Unity is pretty easy using the FBX format, which 3DS max, Revit, and a lot of other things export.   Seems pretty straight forward, right?20161010_092940For the geometry it actually is.   Revit exports fbx, but it uses Autodesk material definitions, which don’t import into Unity.  Everything, with only a few exceptions, comes in with the same material, called Default.  The picture above is a Revit model of a brew pub, with some basic Unity lighting, ported to the C4 using GetReal3D.

The big issue here is materials in the 3D scene, and how they’re defined.   Revit uses a material definition that doesn’t export into something that Unity can read in.   Revit ties the material to the object definition, so there can be many different materials.  Different manufacturers can define different materials in Revit.   Unity, for now, isn’t going to care if a component comes from Bradley or Cooper, because they’re going to look the same, but it makes a difference in Revit.

I opened the model in 3DS Max and could see that all the materials coming from Revit were of type ‘Autodesk Material’.   In focused systems like Max or Revit, it makes sense that there would be material definitions that catered to those specific rendering environments.   FBX, which is what Unity needs currently, only supports ‘Standard’ materials.

Turns out there’s a paid solution, depending on whether or not Max 2017 is a paid solution to you.   There’s a new functionality in 3DS Max 2017 called the ‘Scene Converter’ that seems to be just a front end dialog for a collection of max scripts.   It’s not a default conversion rule for some reason, but there’s one available in the conversion scripts folder called ‘Autodesk Material to Standard Material’.

So here’s the workflow that’s works best for me so far:

  • Don’t export FBX from Revit.  Import the Revit file into Max 2017.   Combine entities by materials.  This will result in all the geometry being grouped into materials, regardless of how they’red drawn.  You’ve broken the Revit entity definitions at this point, but it will make it easier to visualize.
  • Every Material will be named ‘Standardmaterial’.  You need to go through and manually rename every material.  It doesn’t matter what the name is, just so long as it’s unique.  This well keep all of the problem materials from being lumped into one ‘standardmaterial’ definition in the exported file.
  • Export from Max as an FBX file.  There will  be quite a few materials that have maps which don’t export.
  • These maps are probably bump maps.   When you import the model into Unity, you’ll have to convert the bump maps from Revit into Normal maps.  You might have to re-assign the normal maps in the materials that are missing them.
 Once the fbx is in Unity, the objects will be grouped by material.   That is, if in Revit there were 500 objects all with the same material, in Unity they would all be one object, named after the material.

4 Comments


  1. Hi,

    thanks for sharing your workflow for revit to unity, I see that you also posted a photo of a CAVE system. May I know what middleware you use to bridge unity with CAVE?

    Reply

    1. Thanks for the comment. We’re using GetReal3D for Unity. It’s a commercial product by Mechdyne. There are a couple of open source solutions we’ve played with, but you get what you pay for 😉

      Reply

  2. Some differences between Unity and Unreal:

    Unity uses Scripting languages like UnityScript and C# while Unreal uses C++, and scripting languages like Lua.

    Unreal includes Blueprints while in Unity you need to get an asset like PlayMaker to do things without code.
    Unity is more oriented towards one-man devs while Unreal favors teams with separate skillsets. While teams can use Unity and one person can tackle Unreal without issues, is is not as optimal from my experience.

    Unreal provides better graphic capabilities and sometimes better performance, Unity provides a more streamlined development process specially on the prototype phase.

    Unreal provides the full source code at no cost. Unity give some open source components but the full engine needs a paid license (not cheap).

    Unreal is free of charge upfront and only wants 5% of your quarterly revenue if it exceeds $3000. Unity gives a free license but if you want to be taken more seriously you need to pay a license per platform.

    So far Unreal is more stable on console platforms than Unity, but Unity is easier to develop for mobile devices. Creating 3d models in both softwares it’s quite easy!

    Reply

    1. Yep, all good points. I looked at both, and we’ve done a couple of little projects with Unreal. What really clinched unity for us is the streamlined development and prototype development you mentioned.

      Reply

Leave a Reply

Your email address will not be published. Required fields are marked *