Hello everyone!
I am currently working on a project that uses the speckle/viewer^2.11.4.
I need to implement a filter that shows or hides objects based on given objectIds.
For the implementation I’m using this very helpful documentation: Notion – The all-in-one workspace for your notes, tasks, wikis, and databases.
I have the problem that the ghostmode on the hideObjects-function doesnt seem to work properly for my case. Maybe I’m doing it wrong but the objects are still somewhat visible and they are also selectable. At least they get detected by the:
this.viewer.on(ViewerEvent.ObjectClicked, async (selectionInfo: SelectionEvent) => { ... }
SelectionEvent.
I need to completely hide the objects and have the selectionEvent ignore them. Or at least get an Indicator, when a Hit is in ghostMode.
Just for reference. This is a really simple piece of code that I use to hide Objects:
applyObjectsFilter = async (objectIds: string[]) => {
await this.viewer.hideObjects(objectIds, ' ', true, true)
}
Here is how the WIP viewer looks like. The door is selected, eventhou its hidden.
Any ideas on how to archieve that?
(btw I have noticed that the code example in the documentation for showObjects and hideObjects seem to have wrong parameters, because the showObjects example has the ghoseMode-parameter and the hideObjects doesnt.)
Thank you