From 70b4b7ccbbab5f86f2c43ccbc16364d079ef1d2a Mon Sep 17 00:00:00 2001 From: Mukesh Sahay Date: Thu, 23 Mar 2023 14:26:00 -0700 Subject: [PATCH] fix(composer): black screen on Matterport scene fix(composer): show matterport section in Edit mode only --- packages/scene-composer/package.json | 2 +- packages/scene-composer/src/components/WebGLCanvasManager.tsx | 2 ++ packages/scene-composer/src/components/panels/SettingsPanel.tsx | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/scene-composer/package.json b/packages/scene-composer/package.json index bb8768de6..e2adbaa11 100644 --- a/packages/scene-composer/package.json +++ b/packages/scene-composer/package.json @@ -174,7 +174,7 @@ "lines": 76.32, "statements": 75.63, "functions": 75.34, - "branches": 61.11, + "branches": 61, "branchesTrue": 100 } } diff --git a/packages/scene-composer/src/components/WebGLCanvasManager.tsx b/packages/scene-composer/src/components/WebGLCanvasManager.tsx index f0d106f8f..27c61f15c 100644 --- a/packages/scene-composer/src/components/WebGLCanvasManager.tsx +++ b/packages/scene-composer/src/components/WebGLCanvasManager.tsx @@ -40,6 +40,7 @@ export const WebGLCanvasManager: React.FC = () => { const { gl } = useThree(); const domRef = useRef(gl.domElement.parentElement); const environmentPreset = getSceneProperty(KnownSceneProperty.EnvironmentPreset); + const matterportModelId = getSceneProperty(KnownSceneProperty.MatterportModelId); const rootNodeRefs = document.rootNodeRefs; const [startingPointerPosition, setStartingPointerPosition] = useState(new THREE.Vector2()); @@ -121,6 +122,7 @@ export const WebGLCanvasManager: React.FC = () => { rotation={[THREE.MathUtils.degToRad(270), 0, 0]} onPointerUp={onPointerUp} onPointerDown={onPointerDown} + renderOrder={matterportModelId ? 1 : undefined} > diff --git a/packages/scene-composer/src/components/panels/SettingsPanel.tsx b/packages/scene-composer/src/components/panels/SettingsPanel.tsx index 96d0d0a4e..4a9450c15 100644 --- a/packages/scene-composer/src/components/panels/SettingsPanel.tsx +++ b/packages/scene-composer/src/components/panels/SettingsPanel.tsx @@ -134,7 +134,7 @@ export const SettingsPanel: React.FC = ({ valueDataBindingPr )} - {matterportEnabled && ( + {matterportEnabled && isEditing && (