# Migration Guide
# 2.23.8 - 2.25.0
get clippingVolumefromSpeckleRenderernow returns anOBBset clippingvolumefromSpeckleRenderernow accepts bothBox3andOBB- all intersection methods from
Intersectionsnow accept bothBox3andOBBasboundsargument expandBoxRelativefromWorldnow accepts both aBox3and aOBBrequestUpdatefromSectionOutlinesextension now takes an optionalforceargument that forces an update
# 2.23.6 - 2.23.8
Loader'sresourceDatachanged fromstring | ArrayBuffertounknownto allow each loader to define it’s own resource data type
# 2.21.2 - 2.23.6
SmoothOrbitControls's constructor changed. It no longer takes aSceneandIntersections, but only aSpeckleRenderer
# 2.21.1 - 2.22.2
- Entire rendering pipeline got a massive update and it now allows for free user customization as well as user defined passes
pipelineaccessors added toSpeckleRenderer. This allows for user defined rendering pipelinespipelineOptionsaccessors removed fromSpeckleRendererPipelineOutputTyperemoved. The pipeline’s result now depends on the pipeline’s pass configurationDynamicAOPassParamsand it’s default removedStaticAoPassParamsand it’s default removed and replaced byProgressiveAOPassOptions- A series of pre-defined rendering passes as well as entire rendering pipelines have been added
# 2.20.2 → 2.21.1
Vector3andBox3have been removed from the viewer’s exports. They can now be imported from three.js
# 2.19.4 → 2.20.2
- All input mesh vertex colors are now treated as sRGB
# 2.19.1 → 2.19.4
NearCameraCalculationtype option added toCameraControlleroption.UpdateFlags.RENDERno longer resets pipeline. AddedUpdateFlags.RENDER_RESETwhich forces a pipeline reset
# 2.18.16 → 2.19.1
- Added
tasOnlyas a parameter in allintersectvariants. - The existing
firstHitOnlyoption onRaycasternow stops on first intersected TAS, asa well as first intersected BAS from that TAS (iftasOnlyis not set)
# 2.18.15 → 2.18.16
Vector3LikereplacesVectorLikein the arguments oftransformTRSinBatchObjectSpeckleLoaderno longer takes apriorityargument in it’s constructoraddRenderTreefromSpeckleRenderernow takes aRenderTreeas an argument instead of aRenderTreeidgetRenderTreeis now overloaded with a version with no arguments that never returns nullintersectandintersectRayarguments have been moved around and both are now overloaded
# 2.18.14 → 2.18.15
- Asset now has a mandatory
idfield getEnvironmentandgetTexturefromAssetsnow only acceptAssetas argument- The concept of
Providershas been removed entirely CameraProviderhas been replaced bySpeckleCameraCameraControllerEventrenamed toCameraEvent
# 2.18 → 2.18.14
updateClippingPlanesinSpeckleRendererdoes not take an optionalPlane[]argument anymoresetOptionsfromSelectionExtensionhas changed to an accessordisplayOnanddisplayOfffromSectionToolare replaced byvisibleaccessor
# 2.x → 2.18
The introduction of viewer API 2.0 into our stable channel. The changes to the API itself are extensive and there is no point for a step by step guide, as what was previously known as API 2.0 will become the single supported viewer API moving forward.
API 1.0 Backwards Compatibility:
For backwards compatibility reasons we provide a built-in legacy implementation that emulates the old API precisely. Please note that this is meant as a temporary measure which will eventually become naturally obsolete. For this purpose, this migration guide entry will describe moving from any older viewer version to 2.18 while using the legacy implementation
ViewerorDebugViewerinstances are replaced byLegacyViewerThe
hitsfield fromSelectionEventnow holds the hit node and hit point.type SelectionEvent = { multiple: boolean event?: PointerEvent hits: Array<{ node: TreeNode point: Vector3 }> }1
2
3
4
5
6
7
8The synchronous
loadObjectwas removed. Please useloadObjectAsyncwhich works the same way
API 1.0 Full Migration:
The encouraged way, is to conform to the new API as soon as possible. The following guide will attempt to help with the initial migration from the old API to the new one.
Extensions:
A lot of existing viewer functionality has been transferred over to modular Extensions. In order to continue to make use of this functionality, the viewer clients now need to explicitly enable extensions by calling createExtension with the extension’s constructor as the argument. For example, the complete functionality set requires all the extensions enabled
const cameraController = this.createExtension(CameraController)
const selection = this.createExtension(LegacySelectionExtension)
const sections = this.createExtension(SectionTool)
const sectionOutlines = this.createExtension(SectionOutlines)
const measurements = this.createExtension(MeasurementsExtension)
const filtering = this.createExtension(FilteringExtension)
const explodeExtension = this.createExtension(ExplodeExtension)
const diffExtension = this.createExtension(DiffExtension)
2
3
4
5
6
7
8
General:
ViewerParamsno longer has akeepGeometryDataproperty. Redundant geometry data is by default removed and cannot be keptSectionBoxChangedandSectionBoxUpdatedremoved fromViewerEventand replaced bySectionToolEvent.UpdatedinSectionToolextensionSelectionEvent.hitschanged toArray<{node: TreeNode, point: Vector3}>requestRenderfromViewernow takes optionalUpdateFlagsgetObjectsremoved fromViewer. Similar functionality exists withgetObjectinSpeckleRendererexploderemoved fromViewerand replaced by having anExplodeExtensionactive. Explode time is now controller viasetExplodeinExplodeExtensiongetDataTreeandDataTreetype still exist, but are deprecated and will be soon removed completely. Any functionality can now be replicated withWorldTreecameraHandlerremoved fromViewerand replaced bycontrolsaccessor inCameraController.
Section Box:
setSectionBoxremoved fromViewerand replaced bysetBoxinSectionToolgetSectionBoxFromObjectsremoved fromViewerand replaced byboxFromObjectsfromSpeckleRenderergetCurrentSectionBoxremoved fromViewerand replace bygetCurrentBoxinSectionTooltoggleSectionBoxremoved fromViewerand replaced bytoggleinSectionToolsectionBoxOffandsectionBoxOnremoved fromViewerand replaced by theenabledaccessor inSectionTool
Camera:
zoomremoved fromViewerand replaced bysetCameraViewinCameraControllerextensiontoggleCameraProjectionremoved fromViewerand replaced bytoggleCamerasinCameraControllerextensionsetViewremoved fromViewerand replaced bysetCameraViewinCameraControllerextensionloadObjectsignature changed toloadObject(loader: Loader, zoomToObject?: boolean)and it’s now asynchronousloadObjectAsyncremoved fromViewer
Diffing:
diffremoved fromViewerand replaced bydiffinDiffExtensionundiffremoved fromViewerand replaced byundiffinDiffExtensionsetDiffTimeandsetVisualDiffModeremoved fromViewerand replaced byupdateVisualDiffinDiffExtension
Filtering and Selection:
applyFilterremoved fromViewergetObjectPropertiesis now asynchronousshowObjectsandhideObjectsare removed fromViewerand moved toFilteringExtensionisolateObjectsandunIsolateObjectsare removed fromViewerand moved toFilterinExtensionselectObjectsis removed fromViewerand replaced byselectObjectsinSelectionExtensionresetSelectionis removed fromViewerand replaced byclearSelectioninSelectionExtensionhighlightObjectsandresetHighlightare removed fromViewersetColorFilteransremoveColorFilterare removed fromViewerand replaced bysetColorFilterandremoveColorFilterinFilteringExtensionsetUserObjectColorsis remove fromViewerand replaced bysetUserObjectColorsinSelectionExtensionbut usage is discouraged since paradigm no longer appliesresetFiltersis removed fromViewerand replaced byresetFiltersinSelectionExtension
Measurements:
enableMeasurementsremoved fromViewerand replaced by having aMeasurementsExtensionactive and it’senabledaccessor setsetMeasurementOptionsremoved fromViewerand replaced by theoptionsaccessor inMeasurementsExtensionremoveMeasurementremoved fromViewerand replaced byremoveMeasurementinMeasurementsExtension