# Migration Guide
# 2.18.15 β 2.18.16
- Vector3Likereplaces- VectorLikein the arguments of- transformTRSin- BatchObject
- SpeckleLoaderno longer takes a- priorityargument in itβs constructor
- addRenderTreefrom- SpeckleRenderernow takes a- RenderTreeas an argument instead of a- RenderTreeid
- getRenderTreeis now overloaded with a version with no arguments that never returns null
- intersectand- intersectRayarguments have been moved around and both are now overloaded
# 2.18.14 β 2.18.15
- Asset now has a mandatory idfield
- getEnvironmentand- getTexturefrom- Assetsnow only accept- Assetas argument
- The concept of Providershas been removed entirely
- CameraProviderhas been replaced by- SpeckleCamera
- CameraControllerEventrenamed to- CameraEvent
# 2.18 β 2.18.14
- updateClippingPlanesin- SpeckleRendererdoes not take an optional- Plane[]argument anymore
- setOptionsfrom- SelectionExtensionhas changed to an accessor
- displayOnand- displayOfffrom- SectionToolare replaced by- visibleaccessor
# 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
- Vieweror- DebugViewerinstances are replaced by- LegacyViewer
- The - hitsfield from- SelectionEventnow 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
 8
- The synchronous - loadObjectwas removed. Please use- loadObjectAsyncwhich 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 a- keepGeometryDataproperty. Redundant geometry data is by default removed and cannot be kept
- SectionBoxChangedand- SectionBoxUpdatedremoved from- ViewerEventand replaced by- SectionToolEvent.Updatedin- SectionToolextension
- SelectionEvent.hitschanged to- Array<{node: TreeNode, point: Vector3}>
- requestRenderfrom- Viewernow takes optional- UpdateFlags
- getObjectsremoved from- Viewer. Similar functionality exists with- getObjectin- SpeckleRenderer
- exploderemoved from- Viewerand replaced by having an- ExplodeExtensionactive. Explode time is now controller via- setExplodein- ExplodeExtension
- getDataTreeand- DataTreetype still exist, but are deprecated and will be soon removed completely. Any functionality can now be replicated with- WorldTree
- cameraHandlerremoved from- Viewerand replaced by- controlsaccessor in- CameraController.
Section Box:
- setSectionBoxremoved from- Viewerand replaced by- setBoxin- SectionTool
- getSectionBoxFromObjectsremoved from- Viewerand replaced by- boxFromObjectsfrom- SpeckleRenderer
- getCurrentSectionBoxremoved from- Viewerand replace by- getCurrentBoxin- SectionTool
- toggleSectionBoxremoved from- Viewerand replaced by- togglein- SectionTool
- sectionBoxOffand- sectionBoxOnremoved from- Viewerand replaced by the- enabledaccessor in- SectionTool
Camera:
- zoomremoved from- Viewerand replaced by- setCameraViewin- CameraControllerextension
- toggleCameraProjectionremoved from- Viewerand replaced by- toggleCamerasin- CameraControllerextension
- setViewremoved from- Viewerand replaced by- setCameraViewin- CameraControllerextension
- loadObjectsignature changed to- loadObject(loader: Loader, zoomToObject?: boolean)and itβs now asynchronous
- loadObjectAsyncremoved from- Viewer
Diffing:
- diffremoved from- Viewerand replaced by- diffin- DiffExtension
- undiffremoved from- Viewerand replaced by- undiffin- DiffExtension
- setDiffTimeand- setVisualDiffModeremoved from- Viewerand replaced by- updateVisualDiffin- DiffExtension
Filtering and Selection:
- applyFilterremoved from- Viewer
- getObjectPropertiesis now asynchronous
- showObjectsand- hideObjectsare removed from- Viewerand moved to- FilteringExtension
- isolateObjectsand- unIsolateObjectsare removed from- Viewerand moved to- FilterinExtension
- selectObjectsis removed from- Viewerand replaced by- selectObjectsin- SelectionExtension
- resetSelectionis removed from- Viewerand replaced by- clearSelectionin- SelectionExtension
- highlightObjectsand- resetHighlightare removed from- Viewer
- setColorFilterans- removeColorFilterare removed from- Viewerand replaced by- setColorFilterand- removeColorFilterin- FilteringExtension
- setUserObjectColorsis remove from- Viewerand replaced by- setUserObjectColorsin- SelectionExtensionbut usage is discouraged since paradigm no longer applies
- resetFiltersis removed from- Viewerand replaced by- resetFiltersin- SelectionExtension
Measurements:
- enableMeasurementsremoved from- Viewerand replaced by having a- MeasurementsExtensionactive and itβs- enabledaccessor set
- setMeasurementOptionsremoved from- Viewerand replaced by the- optionsaccessor in- MeasurementsExtension
- removeMeasurementremoved from- Viewerand replaced by- removeMeasurementin- MeasurementsExtension
β Loaders AccelerationStructure β
