Can't find speckle kits when using GH SDK

Hi,

I’m developing a custom Grasshopper component, so I’m running Rhino from Visual Studio. When I do this, I get the following error:

If I run Rhino normally, I do not get the error and the converters work fine. In this situation I am also using the custom components that were compiled, so I don’t think there’s a clash between .dll files, though there could be because we do include the following packages as they are used in our custom component.

    <PackageReference Include="Speckle.Core" Version="2.6.1">
      <IncludeAssets>compile; build</IncludeAssets>
    </PackageReference>
    <PackageReference Include="Speckle.Objects" Version="2.6.1">
      <IncludeAssets>compile; build</IncludeAssets>
    </PackageReference>

Do you know what could be causing this?

I have installed the latest version of the Rhino + Grasshopper connector using the Manager 2 preview

EDIT:
Not the speckle kit is actually not showing up at all when running Rhino normally… Not sure what has changed…
image

I also notice now these two errors with the receive when running Rhino normally:
image

Okay after some investigation it appears for be a Rhino/GH issue and which user is being used for the AppData folder.

See picture below. The folders in the top row show the Grasshopper libraries and Rhino plugins present in the Default user’s AppData, while the folders in the bottom row is for my personal user. You can see in the bottom one that the GH and Rhino connectors (I installed the 2.6.5 versions now) are present in my user.
All the way on the right you can see that Speckle manager/kits/accounts is in my user’s appdata folder.

Now when I open Rhino/GH with connector versions 2.6.5, the Speckle connector shows up in Rhino, but not in GH, as seen below

If I install version 2.7 of the connector (so Rhino + GH connector), both connectors show up, but we’re back to the original issue, where the kits and accounts are not found.

So it appears to me that GH and Rhino are looking in different users…

Hey @knut.tjensvoll !

We saw this issue in the past when an old version of Core was being loaded by mistake…

See: Grasshopper Speckle Connector install issues - #17 by teocomi

Here’s some additional context too that might be useful:

When developing/debugging, the kits should get copied in the right location (appdata) when you build the Converter project.
So I would suggest always rebuilding the whole Connector solution.

Accounts, instead need to be set up manually from Manager or Desktop UI (eg the Rhino Connector).

Both accounts and kits should live in %appdata%\Speckle.

You should try avoiding mixing a development version of the connectors and the ones from Manager, as there might be involuntary crossovers.

I’d suggest cleaning your environment by removing any version of the Gh/Rhino connectors and trying again.

Also, as you noticed, from 2.7 onwards the GH&Rhino connectors are bundled together when installing from Manager, not sure if that’s part of your problem as well!

Thanks for the response @teocomi !

So I tried to clean my environment completely by removing everything Speckle related, and I removed any Library Folders I had added in the Grasshopper Developer Settings where additional dlls were loaded. I checked everywhere for SpeckleCore2.dlls and there were none left that could be possibly be loaded. After I uninstalled my Speckle Managers I made sure that the AppData\Roaming\Speckle folders were deleted.

Then I installed the Speckle Manager v2 and the Rhino + Grasshopper connector v2.7.
Still didn’t work.
Then finally I tried to copy the Kits folder from <MyUser>\AppData\Roaming\Speckle to Default\AppData\Roaming\Speckle, and it finally worked.

So it doesn’t seem to me that it’s the same issue as Merijn had (which coincidentally I was there for and we frantically trying to fix it, and I actually didn’t have that issue that time :smiley: ). It seems rather that the issue is that different AppData folders are being used in different situations (one by Rhino and one by GH) for some reason… Not sure how this happened, but I’m starting to think that it’s an issue I might have to bring up with McNeel…
When I open the Special Folders > Components Folder from GH, it opens it in the Default user, but SpeckleRhino2 is installed in my user folder…

I also had to copy Accounts.db from my my user to the Default user in order for the GH connector to find the accounts I logged into in the Manager for Speckle

@knut.tjensvoll this is rather odd! Do you know if your machine has any sort of virtualization or network account management set up?

If you type %appdata% in windows explorer, where does it take you?
And what if you type Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData); in a gh C# node?

image

I remember Default Kit error being caused by installing of different versions for Rhino and Grasshopper connectors. I had it before and once i made sure they were same, it disappeared on my end.

1 Like

%APPDATA% takes me to my user, but…
image
:open_mouth:

Edit: I do have network account management set up as it is a work laptop. However I haven’t had this issue before.

@gokermu Yeah indeed, but I tried to clean everything and it didn’t work…
And it does seem now that the issue is the wrong user folder is being used.

Will try to see if there’s a way to change it in GH (or Rhino)

Hey @knut.tjensvoll

Can you please do an additional test for me? What does Environment.ExpandEnvironmentVariables("%AppData%") return if you put that inside a GH C# node instead?

@teocomi %AppData% gives the one on the bottom

1 Like

Hi @knut.tjensvoll!

Sorry to have you poking around… but it’s the only way we can figure out what’s going on with your specific setup.

As I understand it, the Default user in Windows is not something we should ever be touching, as it’s the “template” for any new user’s in that machine.

I’ve got one extra test for you…It’s weird that the SpecialFolder.ApplicationData points to the default though, could you try and check if this line of code does return your user profile (not the Default one)

Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)

We may be able to work around your issue by just grabbing the proper user profile and appending /AppData/Roaming at the end, but i’d like to confirm that it actually points to the user you’d expect :slight_smile:

Hi @AlanRynne ,

So that actually gives me, so that’s good.
image

But still the ApplicationData is in the Default folder… So weird…
image

1 Like

Ok…this gives me some hope of fixing this on our side hehe :upside_down_face:

Let me have a chat with the team and I’ll get back to you!

Okay thank you very much for your help so far @AlanRynne and @teocomi !

1 Like

We might push a “preliminary version” of this fix for you to test sometime today/tomorrow, but meanwhile I have 2 new questions for you @knut.tjensvoll :smiley:

  • We’re using the same logic in the KitManager and the Account selection node, so it just dawned on me… does your account node pick up the accounts setup in Manager properly?
  • Just to triple check, that path C:\Users\909587 is in fact the correct path for your current user, right?

Thanks again for your patience while we figure this out! :smiley:

@knut.tjensvoll We released version 2.7.1-appDataFix last night, could you install it and check if that does fix the Kit issue for you?

It’s not really a “full fix”, just some quick changes we made for you to be able to give it a go :slight_smile:

If that works, we’ll implement it everywhere it’s needed so that we’ll always pickup the right user folder.

@AlanRynne Thanks for helping out! And sorry that I haven’t responded, but it’s been quite busy. I unfortunately don’t have time to test today, but I’ll definitely test it on Monday or maybe even during the weekend.

Nope it didn’t, so I had to copy all of the below into the Default/AppData/Roaming/Speckle folder.

Yes indeed 909587 is the correct path :slight_smile: