xeokit / xeokit-sdk

Open source JavaScript SDK for viewing high-detail, full-precision 3D BIM and AEC models in the Web browser.
https://xeokit.io
Other
715 stars 286 forks source link

QUESTION: How to avoid duplicate object ids when loading same XKT model multiple times #1262

Closed intrida-dev closed 9 months ago

intrida-dev commented 9 months ago

We are using xeokit-sdk with version number '2.4.1'. We want to load single XKT model multiple times in scene. For that we are referring your example: https://xeokit.notion.site/Viewing-Multiple-Models-71b73627d97840f7887275ea6ac4ed4a

We have already created XKT files and trying to load them using XKTLoaderPlugin.

When we load same XKT multiple times to scene the ids against each entity get duplicated and it becomes difficult to identify each entity individually (for highlight, xray, select etc.).

How can we avoid having duplicate entity ids when same XKT model is loaded twice?

xeolabs commented 9 months ago

Try the XKTLoader's globalizeObjectIds option: https://xeokit.github.io/xeokit-sdk/docs/class/src/plugins/XKTLoaderPlugin/XKTLoaderPlugin.js~XKTLoaderPlugin.html#instance-get-globalizeObjectIds

intrida-dev commented 9 months ago

This helped us. Thanks :-)