I'm using Autodesk Viewer 7.x and trying to load multiple models using the MultipleModelUtil.js utility from this GitHub repo: đź”— https://github.com/yiskang/MultipleModelUtil
However, I'm encountering the following error:
javascript
NodeConsolidation.js:362
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'transparent')
First, I confirmed that it is not a MultipleModelUtil.js issue. (Reference: https://github.com/yiskang/MultipleModelUtil/issues/2)
This happens when I try to load multiple IFC models. I suspect this might be due to one of the following:
- A conflict in viewer settings
- Running on HTTP (not HTTPS), possibly preventing OPFS caching from working correctly?
Below is a screenshot of the error (loading two IFC files):
Here is a simplified version of my code:
javascript
const MODEL_LIST = [
{ name: "filename1.ifc", urn: "urn:..." },
{ name: "filename2.ifc", urn: "urn:..." }
];
Autodesk.Viewing.Initializer(options, function () {
viewer = new Autodesk.Viewing.GuiViewer3D(document.getElementById('viewer'));
const startedCode = viewer.start();
settingProfile();
if (startedCode > 0) {
console.error('Failed to create a Viewer: WebGL not supported.');
return;
} else {
const multiModelUtil = new MultipleModelUtil(viewer);
multiModelUtil.options = {
alignment: MultipleModelAlignmentType.ShareCoordinates,
};
multiModelUtil.processModels(MODEL_LIST);
}
});
function settingProfile() {
try {
const viewerProfileSettings = {
settings: {
optimizeNavigation: false,
ghosting: true,
antialiasing: true,
lineRendering: false,
edgeRendering: true,
reverseMouseZoomDir: true,
},
};
const viewerProfile = new Autodesk.Viewing.Profile(viewerProfileSettings);
viewer.setProfile(viewerProfile);
} catch (error) {
console.error('Error applying profile settings:', error);
}
}
My questions:
- What could be causing the reading 'transparent' error?
- Is it related to model alignment, profile settings, or problems using OPFS in HTTP operating environment?
- Has anyone else successfully used MultipleModelUtil to load multiple IFC models with shared coordinates?
Environment:
Viewer version: 7.x
- Browser: Chrome (latest)
- Hosting: Local server via HTTP (not HTTPS)
- Models: Revit-exported IFC files
Any help would be appreciated!
Cannot read properties of undefined (reading 'transparent') error message capture image1
Cannot read properties of undefined (reading 'transparent') error message capture image2
