Speckle Base deserialization issue

Hi!

I’m retrieving a Speckle Base object from a server as a json into a custom Grasshopper component. In the component I deserialize it as follows:

Base DataFusrObjects = Operations.Deserialize(speckleJson)

What comes out of this looks fine to me, as shown here:

However, after this we have issues, as shown in the picture below. The DSO component works fine with it, but the ESO does not. To me it looks like both these components are doing the same and casting the inputObj as IGH_Goo before GetData, so I don’t understand what the issue is.

And we get this when we try to use the Speckle Base object ourself in another component:

image

Not fully aware on the data fuser object types and what you expect from the deserialisation. It falls back to being a Base with dynamic props most likely because there’s no c# type it can match from the loaded kits.

Regarding this:

It’s most likely caused by the fact that Grasshopper wraps objects in its special types, so your input in your component is not a Base class, but a GH_ObjectWrapper type. You can access the real object by using its .value if i remember correctly.

Regarding the DSO/ESO - I’ll ping @AlanRynne (also, Alan, please correct me if the above stuff is wrong, it’s been ages i did any gh dev work :older_man: )

Hi @dimitrie , thanks for the response!

So the DataFusrObject is just the name we give to the variable because our Speckle-connected platform is called DataFusr. It’s a Speckle Base object, as seen in the first picture, and it contains various Speckle objects (native and custom). So it should be a Base object.

So at the moment of SetData, it’s still a Speckle Base object.

But I managed to it to work now in our component! I had to make sure that it was properly cast to a GH_ObjectWrapper type, and then I can get the .value. Previously it was just an object.
Thanks for the tip!

1 Like

Hey @knut.tjensvoll!

Sorry to hear you’re having some issues! I’m not really sure how this could be happening

your assumption is correct, but I’ll have to double check this anyway.

Is the error you’re getting the same that ESO produces? or does it spit out something else entirely?

I’ll try to repro on my side and get back to you. Thanks for reporting this!

@knut.tjensvoll

I’m back rather quickly with some good news :wink: There was a slight difference between ESO and DSO input verification that remained undetected until now, as it only affected GH_Goo<Base> objects, and we internally use our own GH_SpeckleBase (which was already dealt with)

I’m pushing the fix to be released on our next 2.10 version. If this is blocking you let me know and we can release it as a hotfix for 2.9.

Testing for 2.10 will start next week so hopefully you won’t have to wait too long for the next release anyway.

You can check the fix here Fix(gh): Handle `GH_Goo<Base>` objects in `ESO` by AlanRynne · Pull Request #1830 · specklesystems/speckle-sharp · GitHub

Thanks again!

3 Likes

@AlanRynne

Great that you found the fix so fast! Thanks! I don’t need the fix urgently, so no need for a hotfix :slight_smile:
The most important part was that it was working in our own component.

1 Like