Skip to content

Commit

Permalink
Support for lower case 'objects'
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexandruPopovici committed Jul 18, 2024
1 parent 393d08d commit 1779525
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions packages/viewer/src/modules/loaders/Speckle/SpeckleConverter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,10 @@ export default class SpeckleConverter {
return (obj.transform || obj.Transform) as Array<number>
}

private getInstanceProxyDefinitionObjects(obj: SpeckleObject): Array<string> {
return (obj.Objects || obj.objects) as Array<string>
}

private createTransformNode(obj: SpeckleObject) {
const transformNodeId = MathUtils.generateUUID()
const transformData = this.getEmptyTransformData(transformNodeId)
Expand All @@ -577,7 +581,9 @@ export default class SpeckleConverter {
const transformNode = this.createTransformNode(obj)

this.tree.addNode(transformNode, node)
const objectApplicationIds = definition.model.raw.Objects
const objectApplicationIds = this.getInstanceProxyDefinitionObjects(
definition.model.raw
)
for (const objectApplicationId of objectApplicationIds) {
const speckleData = this.instancedObjectsLookupTable[objectApplicationId]
const instancedNode = this.tree.parse({
Expand All @@ -601,7 +607,7 @@ export default class SpeckleConverter {
let consumeApplicationIdsCount = 0
for (const k in this.instanceDefinitionLookupTable) {
const definition = this.instanceDefinitionLookupTable[k]
const objects = definition.model.raw.Objects as string[]
const objects = this.getInstanceProxyDefinitionObjects(definition.model.raw)
for (let i = 0; i < objects.length; i++) {
consumeApplicationIds[objects[i].toString()] = null
consumeApplicationIdsCount++
Expand Down

0 comments on commit 1779525

Please sign in to comment.