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
728 stars 287 forks source link

FIX: Manually adding model to TreeViewPlugin ignores rootName #1225

Closed mlankamp closed 10 months ago

mlankamp commented 12 months ago

Describe the bug Configure the treeview plugin to not load the model automatically, and add the model to the treeview manually

To Reproduce

const treeview = new TreeViewPlugin(viewer, {
    containerElement: document.getElementById("treeViewContainer"),
    hierarchy: "types",
    autoExpandDepth: 1,
    autoAddModels: false
});

const sceneModel = xktLoader.load({
    id: "myModel",
    src: "../../assets/models/xkt/v8/ifc/IfcOpenHouse4.ifc.xkt"
});

sceneModel.on("loaded", ()=>{
    treeview.addModel(sceneModel.id, {rootName: "testing"});
});

Expected behavior The root node of the treeview should have the name of the specified rootName (in the example above testing)

mlankamp commented 10 months ago

@xeolabs any idea when this fixed? I can try to fix it