Skip to content

Commit

Permalink
Fix handling of missing scenes in the Web Viewer (AcademySoftwareFoun…
Browse files Browse the repository at this point in the history
…dation#2124)

JsViewerX attempted to use a cube when the selected GLTF file contained no model, but the code never added it to the scene.
  • Loading branch information
samip authored Dec 5, 2024
1 parent f9a4222 commit bf2804d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions javascript/MaterialXView/source/viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,14 @@ export class Scene
}

this.#_rootNode = null;
const model = gltfData.scene;
let model = gltfData.scene;
if (!model)
{
const geometry = new THREE.BoxGeometry(1, 1, 1);
const material = new THREE.MeshBasicMaterial({ color: 0xdddddd });
const cube = new THREE.Mesh(geometry, material);
obj = new Group();
obj.add(geometry);
model = new Group();
model.add(cube);
}
else
{
Expand Down

0 comments on commit bf2804d

Please sign in to comment.