Issues with Unity prefabs and installing from package manager with git URL

Hello! I just started using Speckle to attempt a Revit > Unity workflow for some BIM uses.

When I import my Revit model via the StreamManager component it works somewhat ok. The problem is if I try to create a prefab from the imported assets the prefab is created, the structure of the model is preserved in the prefab hierarchy, but there is no geometry. When I try to re-use the prefab it is empty.

I am also very new to unity to maybe I am doing something else wrong? Thanks for the help.

2 Likes

Hi Thanks for reaching out!

I’ll have to do some investigating. Currently we save meshes to the scene, rather than as assets, so this is likely why prefabs aren’t working properly. This sounds like a bit of an oversight on our part :sweat_smile:.

I’ll ping @haitheredavid, just in case he’s run into this issue before.

It would be great to offer a “Create Assets” option to the Stream manager. I’ve created a GitHub issue for this feature.

Thanks for bringing this to our attention.

1 Like

We ran into this issue before with trying to save the speckle stream as a prefab. Seems like unity changed the way they let prefabs store their meshes from the scene. If I remember correctly I think the solution was to serialize all the speckle data into the prefab. But that is not yet supported.

@FilipeFinco you’re using the unity connector properly, it just doesn’t support unity’s new way of prefabs

1 Like

Thanks @Jedd and @haitheredavid for the information. Indeed having it create assets on import would be interesting. I know Tridify BIM Tools for Unity does that automatically when the model is imported.

Also an additional note: When trying to install Speckle from unity package manager from git URL link (as described here: Unity | Speckle Docs) the installation fails. Workaround was to download the zip file and then manually add the package using add from disk option.

2 Likes

:scream: The git install shouldn’t be failing.
Could you send the error message, and tell us what version of Unity you are using?
Also what OS you are on using.

1 Like

@AlanRynne and I have discovered a potential reason why the install could fail. It is quite easy to accidentally copy the git URL from the docs with a trailing space :man_facepalming:

I’ll try and update the docs, so it’s harder to do this by accident.

@Jedd I double checked the link:

https://github.com/specklesystems/speckle-unity.git?path=/Packages/systems.speckle.speckle-unity

and tried again. Still was not possible to install from URL with the following error:

[Package Manager Window] Error adding package: https://github.com/specklesystems/speckle-unity?path=/Packages/systems.speckle.speckle-unity.
UnityEditor.EditorApplication:Internal_CallUpdateFunctions ()

I’m using Windows 10 home 21H2 and Unity version 2020.3.29f1

Thanks for the info, Hopefully we can find the root cause. I’ll do some more investigating today.

Please can you also make sure you have git installed as this is needes to install packages from git.

1 Like

I did not know it was required to have git installed. So now I installed it and tried again but has given the same error on package installation. But maybe after installation of git there are additional steps to activate it in Unity? I am very new to most of this so I have no idea xD

1 Like

There shouldn’t be anything special you have to do besides having git installed. Maybe a PC restart is required after installing git?
I would have expected Unity to be giving a more descriptive error message in any case. So hearing this is a little disappointing. :disappointed:

Going forward, It may be that installing through git is too much of a hassle for our primary install method. I might consider releasing the unity package differently to make install easier.

1 Like

So after updating to Unity version 2021.2.15f1 and installing git I am now able to install the package from URL. Thanks for the help!

4 Likes

Excellent,
I’ll make sure to clarify in the docs the need for git, and we may look into a better way to release the package in future.

1 Like