It seems that there is no way to fetch Rhino Layer Names through GraphQL, e.g.
How to fetch Layer names commited from Rhino , e.g. SITE:LAND
):
It seems that there is no way to fetch Rhino Layer Names through GraphQL, e.g.
How to fetch Layer names commited from Rhino , e.g. SITE:LAND
):
Layers are dynamic members of the commit Base
object, you can access the full commit JSON object with:
query{
stream(id: ""){
object(id: "")
{
data
}
}
}
Keep in mind that the rhino connector also sends Blocks
and Named Views
in their own containers in addition to Layers!
It is not very good to have an empty id for so crucial information. The Layer names is the only meta data human understandable. I am struggling on how to extract it from parsed Json in Unreal.
These are working
SpeckleObject->GetStringField(“referencedId”)
SpeckleObject->GetStringField(“speckle_type”)
SpeckleObject->GetObjectField(“renderMaterial”)
but since layer name is stored as a varying key name I can not retrieve it so simple.
I did this
// Iterate over Json Values
for (auto currJsonValue = SpeckleObject->Values.CreateConstIterator();
currJsonValue;
++currJsonValue)
{
// Get the key name
const FString Name = (*currJsonValue).Key;
if (Name.Contains("::"))
{
UE_LOG(LogTemp, Warning, TEXT("Key Name -> %s"), *Name);
}
}
which gives me the Layer names
LogTemp: Warning: Key Name -> @SITE::LAND
LogTemp: Warning: Key Name -> @SITE::ROAD
LogTemp: Warning: Key Name -> @SITE::RIVER
LogTemp: Warning: Key Name -> @SITE::TREES
LogTemp: Warning: Key Name -> @SITE::BUILDINGS
LogTemp: Warning: Key Name -> @SITE::SITE_BOUNDARY
However, this is not a good option as the if statement causes big delays