Where was the data originating?
A Speckle Commit can have other objects detached from the source geometry that enables the Speckle Magic to work.
Or the objects could be views. or data chunks defining the meshes
If you want to filter to just those visible, you can use query filter.
firstly, you can limit the recursion through all the children of children you see, e.g.
children(depth:1)
{
"data": {
"stream": {
"object": {
"children": {
"objects": []
}
}
}
}
}
children(depth:2)
{
"data": {
"stream": {
"object": {
"children": {
"objects": [
{
"id": "4c66c1437fc429f23f919faacb29ddbe",
"data": {
"id": "4c66c1437fc429f23f919faacb29ddbe",
"name": "Default",
"visible": true,
"elements": [
{
"referencedId": "80de87ca1e03b571bac2526968a98515",
"speckle_type": "reference"
},
{
"referencedId": "e4f90023ad3b18dd42e71c9030d21ffe",
"speckle_type": "reference"
},
{
"referencedId": "be753a5b55038387e80a4da76b2ea03c",
"speckle_type": "reference"
}
],
"speckle_type": "Objects.Organization.Collection",
"applicationId": "03f65291-4e2b-421a-832d-bb698dabfbd9",
"collectionType": "layer",
"totalChildrenCount": 0
}
}
]
}
}
}
}
}
Increasing that value will return more objects - again; it depends on where the data originates as to what the structure of the commit ends up being
If you want only to have display geometry objects, you can try.
children(depth:1000, query: $myQuery)
with query variables:
{"myQuery":[
{
"field": "displayValue",
"value": "_",
"operator": "!="
}
]}
In my example stream this gives:
{
"data": {
"stream": {
"object": {
"children": {
"objects": [
{
"id": "3357d9d5d1f88a4809bb13d5eabdebf4"
},
{
"id": "9234f155724b785653a53c9fb7b2d429"
},
{
"id": "da637f6e105f119be52e5a87a6e7afc4"
},
{
"id": "e19955cd2e295619587b53a748f7c246"
}
]
}
}
}
}
}
This might work for you, except that in my case, those 4 geometry objects are actually visible in the viewer as 3 instances of a Block, so instead, your result could be a single object inside the definition object and not the three instances.
What you want with “the ids of the visible objects” may not be so straightforward a question; hence my question to you of, can you describe your intent, and we can guide you toward a solution?