updateClippingPlanes
in SpeckleRenderer
does not take an optional Plane[]
argument anymoresetOptions
from SelectionExtension
has changed to an accessordisplayOn
and displayOff
from SectionTool
are replaced by visible
accessorThe 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.
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
Viewer
or DebugViewer
instances are replaced by LegacyViewer
The hits
field from SelectionEvent
now holds the hit node and hit point.
type SelectionEvent = {
multiple: boolean
event?: PointerEvent
hits: Array<{
node: TreeNode
point: Vector3
}>
}
The synchronous loadObject
was removed. Please use loadObjectAsync
which works the same way
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.
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)
ViewerParams
no longer has a keepGeometryData
property. Redundant geometry data is by default removed and cannot be keptSectionBoxChanged
and SectionBoxUpdated
removed from ViewerEvent
and replaced by SectionToolEvent.Updated
in SectionTool
extension