So I did a bit of research on the topic. The issue is with Materials . Apparently the Revit Material library is not compatible with Unity, so when importing Revit into Unity its all grey. Oh dear.
So I thought I’d try out some approaches that I saw posted on the web. With minimal success through a number of different issues.
Method 1- Revit to Unity
Discussed in this forum suggests you export from Revit to FBX into Unity and then assign materials in Unity.
This brought a model in but it had no materials associated with it.
I have a clean install of Unity (latest build) and it has no materials, so I had to go searching for some free assets to import into the project. After importing material assets into Unity I could then select elements in Revit and, once selected, drag a material across to associate with that element. I could select a whole group of elements (eg windows) and put the material “Glass” onto those. That worked well. But its quite tedious to do.
I think in the comments of the forum one person said that once you’d assigned materials in Unity to that project then when the model was updated (the Revit FBX re-imported ) then the materials would be remembered.
The process is hard work, even only assigning a few materials to say 1/ Walls, roof , window etc. And the reason for doing this is so you can have a first person shooter (FPS) experience in the model. I think the Revit Add in is far more effective, maybe not great with the materials, but definitely quicker.
Also the file size of the Revit.FBX file is about 45MB for the model.
Maybe something with simple forms and you wanted to walk around the outside of the forms to get a sense of the spaces then this may be a useful method.
2. Use 3D Studio Max to do something with materials (3ds max 2018 and above)
3. Bring into Unity, play around with features/elements, then Build a standalone executable file that you can distribute.
After following the workflow, which I did find slow as Revit is a big programme, so is 3DSMax, and having Unity (also a big programme) open at the same time and all doing things caused my laptop to struggle.
The image below is the model in 3DSMax at time of export. I did do something with Red walls for some wall elements in the original revit model but all the walls seem to be red. I’m sure these can be changed either in 3DSMax or in Unity. The concern is the
In item 1. Revit.FBX file is about 45MB for the model.
In item 2. The export 3DSMax.FBX file is 459Mb, 10x as big. I am waiting for Unity to load it. It seems to be struggling with the import as an asset.
This seems like heavy going for a FPS experience. Maybe there can be some efficiencies over time but I’m not impressed with it so far. It seems to have frozen my Unity instance, unfortunately I’m doing something else on the computer so can’t reboot at this moment. After reboot still did not want to bring the file in, so I think I’ll give this one up as too hard a workflow.
Compiling a build in Unity
The 2nd video below steps through how to do a build in Unity for an executable file. As I’m not satisfied with either of these imports into Unity I don’t think I’ll bother doing that exercise at this time.
Method 3- Add-In Export to Unity (Not covered here)
Fossiking in the App-store popped up this add-in Export to Unity by Emanuel Favreau. I have come across his stuff before, he does some very smart stuff. This is a $10 add-in and has a 30 day trial. I am planning to do another post about this app after I download it as it has some interesting features about displaying parameter values.
I downloaded this but I only have a version of 188.8.131.520 . “Export to Unity” will work only with Revit version 2018.1 or higher. So I cannot even try it out. Very frustrating.
See this video about it, it looks really interesting:
I decided to download Revit 2019 to try out this app. When I click the Model button in the app and create By Entities, so that it can create parameters, it creates a .Obj file and a .mat file.
But when I presss the properties button it just errors out (see 2nd image below).
It doesn’t even show parameters at all. I have de-installed and re-installed a couple of times but to no avail.
I was excited by this, as it showed parameters but then I thought this can be accomplished more easily by my 3DPDF process. So for all the effort of trying to manage the unity package it wasn’t worth the effort.
I came across this 2019 app Unity Viewer for Autodesk® Revit® by Proto Tech Solutions that allows you to grab some elements and then it compiles it for Unity Viewer with a weird background. Not sure what the point of it is, it doesn’t seem to bring the materials across at all. Quirky but fun.
I followed a few of Brackeys videos on using unity to build a simple game. See the intro video and other videos in the series. I really like his style and pace. Really really impressive in my opinion.
He had a couple of good pointers to some other programmes as well. 1/ For compiling the files into a single executable, watch this video and about 6 minutes into the video, and a 2nd one for Music for video games .
The tool is Inno Setup , follow link. I’d watch the video first as there are some subtleties with the folder organization. But a useful tool none the less.
The 2nd tool was a a music programme Bosca Ceoil. A distraction but good to know how those sounds are made.
Overall not a very successful workflow to get revit into Unity for a FPS experience. Maybe for smaller models it may work fine, and I do not think this is a particularly big or complex model. With all the effort I have gone to I think I’d just stick to the ACM Bridge add-in. It does its job well and its free without all the other issues that I came up against like file sizes and managing materials. I would still need to do the build from Unity at the end, but after a day of hammering away at this I do not see the benefits for getting materials in a better state.
Overall, Unity is a powerful package but there is no common ground with Revit regarding the materials, I found it hard work generating big files that did not perform very well to accomplish what the potential of the package (unity) has. Just not really compatible. I’ll stick with the original app though, that was nice and easy.