I have two questions that I couldn’t find answers to, either here in the forum or in the documentation. If these topics have already been discussed somewhere, please send me the link.
My first question is about the “View Modes” in the Speckle Viewer. After updating the @speckle/viewer library to version 2.25.7, I noticed that the elements changed their visualization type, with the default now being “Rendered + Edge”.
I’d like to know how I can change the “View Modes” using the @speckle/viewer API.
My second question (or suggestion) is about the mouse wheel button action. Is there a way to change the default action from rotating to moving the loaded model inside the viewer?
I think that, as we are in the process of migrating documents to the new site, the very latest additions may not be fully described, but adding behaviours is covered there for sure.
We’ve updated the docs with the new additions regarding the rendering pipeline API of the viewer.
There are two options when it comes to controlling the rendering pipeline:
You can work with pipelines directly, which can be as simple as:
const renderer = viewer.getRenderer()
/** Say if you want to disable edges/outlines */
const pipelineOptions = { edges: false }
renderer.pipeline = new DefaultPipeline(renderer, pipelineOptions)
Alternatively you can use the ViewModes extension which simplifies the interfacing a bit and it’s also used by our web app
Some examples of working with the viewer rendering pipelines can be seen in the sandbox here where we also define a custom ad-hoc rendering pipeline