# Migration Guide
# 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
β Loaders AccelerationStructure β