Hey everyone, I’m new to Speckle and currently trying to find my way around this amazing tool. A few things are a bit unclear at this point. I am trying to use the Unity connector to send Grasshopper geometry to Unity. It works fine with regular meshes but what I am trying to do is also send some metadata together with the geometry. I found out that if you send an actual BIM model from Revit the SpeckleProperties component gets added to the geometry in Unity which lets you retrieve metadata. My question now is how I can achieve the same using only Grasshopper? I played around with “Speckle schema object” and “Create Speckle object” components in Grasshopper but no success so far. Could anyone here point me in the right direction, provide some resources on how to structure my GH script or even share an example GH script with me? Any help would be much appreciated!
Cheers,
Ben
EDIT:
I had a look at the ConverterUnity.cs file and realized that the Unity converter checks for the speckle type before attaching the SpeckleProperties:
//Object is not a raw geometry, convert it as display value element
GameObject? element = DisplayValueToNative(speckleObject);
if (element != null)
{
// if (!speckleObject.speckle_type.Contains("Objects.Geometry"))
AttachSpeckleProperties(element, speckleObject.GetType(), GetProperties(speckleObject));
return element;
}
return new GameObject();
By getting rid of the if check I’m successfully adding the SpeckleProperties component to my GameObjects which enables me to read the metadata.
I’m still not sure why per default the component does not get attached to objects of type Objects.Geometry. If anyone could clarify I’d be very grateful!