Skip to content

Commit

Permalink
Coloring issue (#2048)
Browse files Browse the repository at this point in the history
* Potential filter material options are now preserved after flattening draw ranges

* Default stream
  • Loading branch information
AlexandruPopovici authored Feb 17, 2024
1 parent 1be2fde commit d5c2479
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
5 changes: 3 additions & 2 deletions packages/viewer-sandbox/src/Sandbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ export default class Sandbox {
this.addStreamControls(url)
this.addViewControls()
this.addBatches()
// this.properties = await this.viewer.getObjectProperties()
this.properties = await this.viewer.getObjectProperties()
this.batchesParams.totalBvhSize = this.getBVHSize()
this.refresh()
})
Expand Down Expand Up @@ -959,7 +959,8 @@ export default class Sandbox {
Floor: 'Floor',
Name: 'name',
TypeName: 'parameters.SYMBOL_NAME_PARAM.value',
Id: 'id'
Id: 'id',
DSD: 'DSD.@TYPE'
}
})

Expand Down
6 changes: 4 additions & 2 deletions packages/viewer-sandbox/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ const getStream = () => {
// prettier-ignore
// 'https://speckle.xyz/streams/da9e320dad/commits/5388ef24b8?c=%5B-7.66134,10.82932,6.41935,-0.07739,-13.88552,1.8697,0,1%5D'
// Revit sample house (good for bim-like stuff with many display meshes)
// 'https://speckle.xyz/streams/da9e320dad/commits/5388ef24b8'
'https://speckle.xyz/streams/da9e320dad/commits/5388ef24b8'
// 'https://latest.speckle.dev/streams/58b5648c4d/commits/60371ecb2d'
// 'Super' heavy revit shit
// 'https://speckle.xyz/streams/e6f9156405/commits/0694d53bb5'
Expand Down Expand Up @@ -355,7 +355,9 @@ const getStream = () => {
// 'https://latest.speckle.dev/streams/55cc1cbf0a/commits/aa72674507'
// 'https://latest.speckle.dev/streams/55cc1cbf0a/commits/a7f74b6524'
// 'https://latest.speckle.dev/streams/85e05b8c72/commits/53f4328211'
'https://latest.speckle.dev/streams/aea12cab71/commits/787ade768e'
// 'https://latest.speckle.dev/streams/aea12cab71/commits/787ade768e'

// 'https://speckle.xyz/streams/a29e5c7772/commits/a8cfae2645'
)
}

Expand Down
15 changes: 12 additions & 3 deletions packages/viewer/src/modules/SpeckleRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -756,23 +756,32 @@ export default class SpeckleRenderer {
flatRanges.push({
offset,
count: count + ranges[k + 1].count,
material: ranges[k].material
material: ranges[k].material,
...(ranges[k].materialOptions && {
materialOptions: ranges[k].materialOptions
})
})
}
continue
}
flatRanges.push({
offset,
count,
material: ranges[k].material
material: ranges[k].material,
...(ranges[k].materialOptions && {
materialOptions: ranges[k].materialOptions
})
})
offset = ranges[k + 1].offset
count = 0
if (k === ranges.length - 2) {
flatRanges.push({
offset: ranges[k + 1].offset,
count: ranges[k + 1].count,
material: ranges[k + 1].material
material: ranges[k + 1].material,
...(ranges[k].materialOptions && {
materialOptions: ranges[k].materialOptions
})
})
}
}
Expand Down

0 comments on commit d5c2479

Please sign in to comment.