Speckle v2 - Unity connector, models importing at wrong scale from revit connector

I’m having an issue with importing streams into unity from Revit source.

This is the expected model in Revit:

Using the Revit connector, I select the {3D} view which should select all model geometry and push.

Note that I do receive some warnings when pushing the model:
Only point based Family Instances are currently supported. at Objects.Converter.Revit.ConverterRevit.FamilyInstanceToSpeckle(FamilyInstance revitFi) at Objects.Converter.Revit.ConverterRevit.ConvertToSpeckle(Object object) at Speckle.ConnectorRevit.UI.ConnectorBindingsRevit.<SendStream>d__9.MoveNext() in C:\Users\circleci\project\ConnectorRevit\ConnectorRevit\UI\ConnectorBindingsRevit.Send.cs:line 85

This is what it looks like in the stream viewer:

This is the result of importing a model into unity

This is the stream https://staging.speckle.dev/streams/5c1cded91b

As you can see some part of the model imports at the correct scale (the smaller model in the foreground), but some family instances import at exactly 1000 times too large (those that can be seen in the distance)

I have repeated this for a few different models coming from Revit. I’m not sure if it’s a problem with the Unity connector or the Revit connector.

Unity version: 2020.3.0f1
Unity connector: GitHub - specklesystems/speckle-unity at 436565e10a38281edb34f24968bbc7a4a50f88bd
Autodesk Revit version 2021 - 20200220_1100(x64)
Revit connector: 2.0.8-beta

Related to Issues with units and geometry coming from Revit · Issue #11 · specklesystems/speckle-unity · GitHub

Hey Jedd,
thanks for the detailed report!

The warning you’re getting is because part of the curtain panels (I think the sliding door) are not currently supported by our conversion, nothing alarming :slight_smile:

The geometry not scaled correctly, instead, means we forgot to correctly set the units on some more objects when converting and sending them out from Revit…
I’ll have another look and let you know!

If you’re interested to know how this works, here’s a quick description: when converting from Revit to Specle, each Revit element becomes a Speckle one (eg a Revit Wall becomes a Speckle wall). For these elements to display nicely in the viewer and other applications we generate a mesh representation of each and set it on the displayMesh property of the object.
This mesh, as well as any other Speckle geometric element, has a unit property that lets us scale it correctly when received in another application. Since units were just introduced recently, we might have forgotten to add them to all Revit’s element conversions and therefore we get the issue you experienced.
Luckily, most times a fix is as simple as this.
On the Unity side, things are simpler and if the meshes received have a units property, they are scaled accordingly.

This is also fixed! I noticed we forgot to set units correctly on stairs, building pads and a few more elements. But I’ve improved that logic so they’re automatically set. LMK if you spot anything else!

We’ll publish a new version of the Revit connector on Monday, otherwise feel free to pull the latest master from speckle-sharp :slight_smile: