From 93e2400aa057e8485e49f2dcbf1dcd2fcb24a611 Mon Sep 17 00:00:00 2001 From: HexaField Date: Fri, 21 Jun 2024 17:44:34 +1000 Subject: [PATCH 1/2] sort resources json --- resources.json | 250 ++++++++++++++++++++++++------------------------- 1 file changed, 125 insertions(+), 125 deletions(-) diff --git a/resources.json b/resources.json index 43bace9..fad9dd9 100644 --- a/resources.json +++ b/resources.json @@ -1,234 +1,197 @@ { - "assets/envmaps/hall.glb": { + "assets/animations/Racer-transformed.gltf": { "type": "file", "tags": [ "Model" ], "dependencies": [] }, - "public/avatars/Adam/1a8a75bafb18c29e94be4f6e0df4503932791c732fd5b85f5991993ffef3199e.ktx2": { + "assets/animations/Racer/740e60973cb1cb9852ebe8821bcaf77f2fda66b68f5ed2c143ef504087968238.bin": { "type": "file", "tags": [ - "Image" + "unknown" ], "dependencies": [] }, - "public/avatars/Adam.gltf": { - "type": "avatar", - "tags": [ - "Model" - ], - "dependencies": [ - "projects/ee-development-test-suite/public/avatars/Adam/1a8a75bafb18c29e94be4f6e0df4503932791c732fd5b85f5991993ffef3199e.ktx2", - "projects/ee-development-test-suite/public/avatars/Adam/1f68862e8529230781b98f1825852cb37039ab137a796da4e1a54368ab308693.ktx2", - "projects/ee-development-test-suite/public/avatars/Adam/3ebba2b690b91a31064fec6d6ca9e1558f4f56ddb804294c4663017e2a2ae8fc.bin", - "projects/ee-development-test-suite/public/avatars/Adam/5cbedd9382f99d1be408692e8d3b4172edb4aa5edcd9d90bca57f7c6b7db4e2b.bin", - "projects/ee-development-test-suite/public/avatars/Adam/9613d363e55e1af7cfb0dfb020bae9e417ccb11f6051da379ac96aa35cba59a0.ktx2", - "projects/ee-development-test-suite/public/avatars/Adam/Adam_data.bin", - "projects/ee-development-test-suite/public/avatars/Adam/ffd667f5c4c57f61a582c47337035d704ae616104df6ee505b3c715455c4c11c.ktx2" - ] - }, - "assets/GLTF/Flight Helmet/FlightHelmet.bin": { + "assets/animations/Racer/a8c5117aec263607fb9b24904949c1de9d246ff5a9518ab40e9555d191274122.ktx2": { "type": "file", "tags": [ - "unknown" + "Image" ], "dependencies": [] }, - "public/avatars/Adam/3ebba2b690b91a31064fec6d6ca9e1558f4f56ddb804294c4663017e2a2ae8fc.bin": { + "assets/animations/Racer/b10cf5cda7f6b46299df899e7d38424f8229b0019cec043bb70f3fc71117dc76.ktx2": { "type": "file", "tags": [ - "unknown" + "Image" ], "dependencies": [] }, - "public/avatars/Adam/1f68862e8529230781b98f1825852cb37039ab137a796da4e1a54368ab308693.ktx2": { + "assets/animations/Racer/fb54d298ab7ec1b2628911e434f40ee06c24543923e0b3e14802cf55092b826a.ktx2": { "type": "file", "tags": [ "Image" ], "dependencies": [] }, - "assets/animations/Racer/a8c5117aec263607fb9b24904949c1de9d246ff5a9518ab40e9555d191274122.ktx2": { + "assets/animations/Racer/Racer_data.bin": { "type": "file", "tags": [ - "Image" + "unknown" ], "dependencies": [] }, - "assets/GLTF/Flight Helmet/FlightHelmet_Materials_RubberWoodMat_OcclusionRoughMetal.ktx2": { + "assets/animations/rings.glb": { "type": "file", "tags": [ - "Image" + "Model" ], "dependencies": [] }, - "assets/LOD/Test_LOD2.glb": { + "assets/animations/tornado-mobile-xr.glb": { "type": "file", "tags": [ "Model" ], "dependencies": [] }, - "assets/GLTF/Flight Helmet/FlightHelmet_Materials_GlassPlasticMat_BaseColor.ktx2": { + "assets/animations/transforms.glb": { "type": "file", "tags": [ - "Image" + "Model" ], "dependencies": [] }, - "assets/graph/default-graph.json": { + "assets/envmaps/hall.glb": { "type": "file", "tags": [ - "Volumetric" + "Model" ], "dependencies": [] }, - "assets/animations/Racer/fb54d298ab7ec1b2628911e434f40ee06c24543923e0b3e14802cf55092b826a.ktx2": { + "assets/GLTF/Flight Helmet/FlightHelmet_Materials_GlassPlasticMat_BaseColor.ktx2": { "type": "file", "tags": [ "Image" ], "dependencies": [] }, - "public/avatars/Adam/5cbedd9382f99d1be408692e8d3b4172edb4aa5edcd9d90bca57f7c6b7db4e2b.bin": { + "assets/GLTF/Flight Helmet/FlightHelmet_Materials_GlassPlasticMat_Normal.ktx2": { "type": "file", "tags": [ - "unknown" + "Image" ], "dependencies": [] }, - "assets/GLTF/Flight Helmet/FlightHelmet_Materials_LensesMat_Normal.ktx2": { + "assets/GLTF/Flight Helmet/FlightHelmet_Materials_GlassPlasticMat_OcclusionRoughMetal.ktx2": { "type": "file", "tags": [ "Image" ], "dependencies": [] }, - "public/avatars/Adam/9613d363e55e1af7cfb0dfb020bae9e417ccb11f6051da379ac96aa35cba59a0.ktx2": { + "assets/GLTF/Flight Helmet/FlightHelmet_Materials_LeatherPartsMat_BaseColor.ktx2": { "type": "file", "tags": [ "Image" ], "dependencies": [] }, - "public/scenes/bpcem-envmap-bake-test.scene.json": { - "type": "scene", - "tags": [], - "dependencies": [] - }, - "assets/GLTF/Flight Helmet/FlightHelmet_Materials_LeatherPartsMat_OcclusionRoughMetal.ktx2": { + "assets/GLTF/Flight Helmet/FlightHelmet_Materials_LeatherPartsMat_Normal.ktx2": { "type": "file", "tags": [ "Image" ], "dependencies": [] }, - "public/scenes/test.scene.json": { - "type": "scene", - "tags": [], - "dependencies": [] - }, - "public/scenes/bpcem-envmap-bake-test-bpcem-hall-bake-1.ktx2": { + "assets/GLTF/Flight Helmet/FlightHelmet_Materials_LeatherPartsMat_OcclusionRoughMetal.ktx2": { "type": "file", "tags": [ "Image" ], "dependencies": [] }, - "assets/GLTF/Flight Helmet/FlightHelmet_Materials_LeatherPartsMat_BaseColor.ktx2": { + "assets/GLTF/Flight Helmet/FlightHelmet_Materials_LensesMat_BaseColor.ktx2": { "type": "file", "tags": [ "Image" ], "dependencies": [] }, - "assets/GLTF/Flight Helmet/FlightHelmet_Materials_MetalPartsMat_Normal.ktx2": { + "assets/GLTF/Flight Helmet/FlightHelmet_Materials_LensesMat_Normal.ktx2": { "type": "file", "tags": [ "Image" ], "dependencies": [] }, - "assets/GLTF/Flight Helmet/FlightHelmet_Materials_RubberWoodMat_BaseColor.ktx2": { + "assets/GLTF/Flight Helmet/FlightHelmet_Materials_LensesMat_OcclusionRoughMetal.ktx2": { "type": "file", "tags": [ "Image" ], "dependencies": [] }, - "public/avatars/Adam/Adam_data.bin": { + "assets/GLTF/Flight Helmet/FlightHelmet_Materials_MetalPartsMat_BaseColor.ktx2": { "type": "file", "tags": [ - "unknown" + "Image" ], "dependencies": [] }, - "assets/Images/testImage.jpg": { + "assets/GLTF/Flight Helmet/FlightHelmet_Materials_MetalPartsMat_Normal.ktx2": { "type": "file", "tags": [ "Image" ], "dependencies": [] }, - "assets/animations/Racer/740e60973cb1cb9852ebe8821bcaf77f2fda66b68f5ed2c143ef504087968238.bin": { + "assets/GLTF/Flight Helmet/FlightHelmet_Materials_MetalPartsMat_OcclusionRoughMetal.ktx2": { "type": "file", "tags": [ - "unknown" + "Image" ], "dependencies": [] }, - "public/scenes/animations-test.envmap.ktx2": { + "assets/GLTF/Flight Helmet/FlightHelmet_Materials_RubberWoodMat_BaseColor.ktx2": { "type": "file", "tags": [ "Image" ], "dependencies": [] }, - "public/scenes/bpcem-envmap-bake-test.thumbnail.ktx2": { + "assets/GLTF/Flight Helmet/FlightHelmet_Materials_RubberWoodMat_Normal.ktx2": { "type": "file", "tags": [ "Image" ], "dependencies": [] }, - "assets/GLTF/Flight Helmet/FlightHelmet_Materials_LensesMat_BaseColor.ktx2": { + "assets/GLTF/Flight Helmet/FlightHelmet_Materials_RubberWoodMat_OcclusionRoughMetal.ktx2": { "type": "file", "tags": [ "Image" ], "dependencies": [] }, - "assets/Videos/HDVideo.mp4": { + "assets/GLTF/Flight Helmet/FlightHelmet.bin": { "type": "file", "tags": [ - "Video" + "unknown" ], "dependencies": [] }, - "public/avatars/Test RPM.glb": { - "type": "avatar", + "assets/GLTF/Flight Helmet/FlightHelmet.gltf": { + "type": "file", "tags": [ "Model" ], "dependencies": [] }, - "assets/GLTF/Flight Helmet/FlightHelmet_Materials_MetalPartsMat_BaseColor.ktx2": { + "assets/graph/default-graph.json": { "type": "file", "tags": [ - "Image" - ], - "dependencies": [] - }, - "public/scenes/animations-test.scene.json": { - "type": "scene", - "tags": [], - "dependencies": [] - }, - "public/avatars/Test Avaturn.glb": { - "type": "avatar", - "tags": [ - "Model" + "Volumetric" ], "dependencies": [] }, @@ -239,197 +202,234 @@ ], "dependencies": [] }, - "public/scenes/Benchmarks.envmap.ktx2": { + "assets/Images/testImage.jpg": { "type": "file", "tags": [ "Image" ], "dependencies": [] }, - "assets/LOD/Test_LOD1.glb": { + "assets/LOD/Test_LOD0.glb": { "type": "file", "tags": [ "Model" ], "dependencies": [] }, - "assets/GLTF/Flight Helmet/FlightHelmet_Materials_LeatherPartsMat_Normal.ktx2": { + "assets/LOD/Test_LOD1.glb": { "type": "file", "tags": [ - "Image" + "Model" ], "dependencies": [] }, - "assets/GLTF/Flight Helmet/FlightHelmet_Materials_RubberWoodMat_Normal.ktx2": { + "assets/LOD/Test_LOD2.glb": { "type": "file", "tags": [ - "Image" + "Model" ], "dependencies": [] }, - "assets/GLTF/Flight Helmet/FlightHelmet_Materials_MetalPartsMat_OcclusionRoughMetal.ktx2": { + "assets/Videos/HDVideo.mp4": { "type": "file", "tags": [ - "Image" + "Video" ], "dependencies": [] }, - "assets/GLTF/Flight Helmet/FlightHelmet_Materials_GlassPlasticMat_Normal.ktx2": { + "public/avatars/Adam.gltf": { + "type": "avatar", + "tags": [ + "Model" + ], + "dependencies": [ + "projects/ee-development-test-suite/public/avatars/Adam/1a8a75bafb18c29e94be4f6e0df4503932791c732fd5b85f5991993ffef3199e.ktx2", + "projects/ee-development-test-suite/public/avatars/Adam/1f68862e8529230781b98f1825852cb37039ab137a796da4e1a54368ab308693.ktx2", + "projects/ee-development-test-suite/public/avatars/Adam/3ebba2b690b91a31064fec6d6ca9e1558f4f56ddb804294c4663017e2a2ae8fc.bin", + "projects/ee-development-test-suite/public/avatars/Adam/5cbedd9382f99d1be408692e8d3b4172edb4aa5edcd9d90bca57f7c6b7db4e2b.bin", + "projects/ee-development-test-suite/public/avatars/Adam/9613d363e55e1af7cfb0dfb020bae9e417ccb11f6051da379ac96aa35cba59a0.ktx2", + "projects/ee-development-test-suite/public/avatars/Adam/Adam_data.bin", + "projects/ee-development-test-suite/public/avatars/Adam/ffd667f5c4c57f61a582c47337035d704ae616104df6ee505b3c715455c4c11c.ktx2" + ] + }, + "public/avatars/Adam/1a8a75bafb18c29e94be4f6e0df4503932791c732fd5b85f5991993ffef3199e.ktx2": { "type": "file", "tags": [ "Image" ], "dependencies": [] }, - "public/scenes/bpcem-envmap-bake-test-bpcem-hall-bake-2.ktx2": { + "public/avatars/Adam/1f68862e8529230781b98f1825852cb37039ab137a796da4e1a54368ab308693.ktx2": { "type": "file", "tags": [ "Image" ], "dependencies": [] }, - "public/scenes/test.gltf": { - "type": "scene", - "tags": [], - "dependencies": [] - }, - "assets/animations/Racer/b10cf5cda7f6b46299df899e7d38424f8229b0019cec043bb70f3fc71117dc76.ktx2": { + "public/avatars/Adam/3ebba2b690b91a31064fec6d6ca9e1558f4f56ddb804294c4663017e2a2ae8fc.bin": { "type": "file", "tags": [ - "Image" + "unknown" ], "dependencies": [] }, - "assets/animations/rings.glb": { + "public/avatars/Adam/5cbedd9382f99d1be408692e8d3b4172edb4aa5edcd9d90bca57f7c6b7db4e2b.bin": { "type": "file", "tags": [ - "Model" + "unknown" ], "dependencies": [] }, - "assets/GLTF/Flight Helmet/FlightHelmet_Materials_LensesMat_OcclusionRoughMetal.ktx2": { + "public/avatars/Adam/9613d363e55e1af7cfb0dfb020bae9e417ccb11f6051da379ac96aa35cba59a0.ktx2": { "type": "file", "tags": [ "Image" ], "dependencies": [] }, - "assets/animations/Racer/Racer_data.bin": { + "public/avatars/Adam/Adam_data.bin": { "type": "file", "tags": [ "unknown" ], "dependencies": [] }, - "public/scenes/test.thumbnail.jpeg": { + "public/avatars/Adam/ffd667f5c4c57f61a582c47337035d704ae616104df6ee505b3c715455c4c11c.ktx2": { "type": "file", "tags": [ "Image" ], "dependencies": [] }, - "public/scenes/Examples.gltf": { - "type": "scene", + "public/avatars/Test Avaturn.glb": { + "type": "avatar", "tags": [ "Model" ], "dependencies": [] }, - "public/scenes/Examples.envmap.ktx2": { - "type": "file", + "public/avatars/Test RPM.glb": { + "type": "avatar", "tags": [ - "Image" + "Model" ], "dependencies": [] }, - "public/avatars/Adam/ffd667f5c4c57f61a582c47337035d704ae616104df6ee505b3c715455c4c11c.ktx2": { + "public/scenes/animations-test.envmap.ktx2": { "type": "file", "tags": [ "Image" ], "dependencies": [] }, - "assets/animations/Racer-transformed.gltf": { + "public/scenes/animations-test.scene.json": { + "type": "scene", + "tags": [], + "dependencies": [] + }, + "public/scenes/animations-test.thumbnail.ktx2": { "type": "file", "tags": [ - "Model" + "Image" ], "dependencies": [] }, - "public/scenes/bpcem-envmap-bake-test.envmap.ktx2": { + "public/scenes/Benchmarks.envmap.ktx2": { "type": "file", "tags": [ "Image" ], "dependencies": [] }, - "assets/LOD/Test_LOD0.glb": { - "type": "file", + "public/scenes/Benchmarks.gltf": { + "type": "scene", "tags": [ "Model" ], "dependencies": [] }, - "assets/GLTF/Flight Helmet/FlightHelmet.gltf": { + "public/scenes/Benchmarks.thumbnail.jpg": { "type": "file", "tags": [ - "Model" + "Image" ], "dependencies": [] }, - "public/scenes/Benchmarks.gltf": { - "type": "scene", + "public/scenes/bpcem-envmap-bake-test-bpcem-hall-bake-1.ktx2": { + "type": "file", "tags": [ - "Model" + "Image" ], "dependencies": [] }, - "assets/GLTF/Flight Helmet/FlightHelmet_Materials_GlassPlasticMat_OcclusionRoughMetal.ktx2": { + "public/scenes/bpcem-envmap-bake-test-bpcem-hall-bake-2.ktx2": { "type": "file", "tags": [ "Image" ], "dependencies": [] }, - "public/scenes/Examples.thumbnail.jpg": { + "public/scenes/bpcem-envmap-bake-test.envmap.ktx2": { "type": "file", "tags": [ "Image" ], "dependencies": [] }, - "public/scenes/animations-test.thumbnail.ktx2": { + "public/scenes/bpcem-envmap-bake-test.scene.json": { + "type": "scene", + "tags": [], + "dependencies": [] + }, + "public/scenes/bpcem-envmap-bake-test.thumbnail.ktx2": { "type": "file", "tags": [ "Image" ], "dependencies": [] }, - "public/scenes/test.envmap.png": { + "public/scenes/Examples.envmap.ktx2": { "type": "file", "tags": [ "Image" ], "dependencies": [] }, - "public/scenes/Benchmarks.thumbnail.jpg": { + "public/scenes/Examples.gltf": { + "type": "scene", + "tags": [ + "Model" + ], + "dependencies": [] + }, + "public/scenes/Examples.thumbnail.jpg": { "type": "file", "tags": [ "Image" ], "dependencies": [] }, - "assets/animations/tornado-mobile-xr.glb": { + "public/scenes/test.envmap.png": { "type": "file", "tags": [ - "Model" + "Image" ], "dependencies": [] }, - "assets/animations/transforms.glb": { + "public/scenes/test.gltf": { + "type": "scene", + "tags": [], + "dependencies": [] + }, + "public/scenes/test.scene.json": { + "type": "scene", + "tags": [], + "dependencies": [] + }, + "public/scenes/test.thumbnail.jpeg": { "type": "file", "tags": [ - "Model" + "Image" ], "dependencies": [] } From e9c976d2c9c8f2991428a0eb8413b5d2ef44282b Mon Sep 17 00:00:00 2001 From: HexaField Date: Fri, 21 Jun 2024 18:09:59 +1000 Subject: [PATCH 2/2] hack fix avatars always spawning and scenes not loading after adding cache busting --- src/benchmarksAllRoute.tsx | 2 +- src/benchmarksRoute.tsx | 2 +- src/examplesRoute.tsx | 2 +- src/sceneRoute.tsx | 11 ++++++++--- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/benchmarksAllRoute.tsx b/src/benchmarksAllRoute.tsx index 6bd8ff2..a048dab 100644 --- a/src/benchmarksAllRoute.tsx +++ b/src/benchmarksAllRoute.tsx @@ -1,4 +1,4 @@ -import '@etherealengine/client-core/src/world/LocationModule' +import '@etherealengine/engine/src/EngineModule' import { setComponent } from '@etherealengine/ecs' import React, { useEffect } from 'react' import { BenchmarkComponent } from './engine/Register' diff --git a/src/benchmarksRoute.tsx b/src/benchmarksRoute.tsx index cdff1ba..589d664 100644 --- a/src/benchmarksRoute.tsx +++ b/src/benchmarksRoute.tsx @@ -1,6 +1,6 @@ import React from 'react' -import '@etherealengine/client-core/src/world/LocationModule' +import '@etherealengine/engine/src/EngineModule' import AvatarBenchmarkEntry from './benchmarks/avatarBenchmark' import AvatarIKBenchmarkEntry from './benchmarks/avatarIKBenchmark' import HeapBenchmarkEntry from './benchmarks/heapBenchmark' diff --git a/src/examplesRoute.tsx b/src/examplesRoute.tsx index 1cf9b54..8a1b530 100644 --- a/src/examplesRoute.tsx +++ b/src/examplesRoute.tsx @@ -1,6 +1,6 @@ import React from 'react' -import '@etherealengine/client-core/src/world/LocationModule' +import '@etherealengine/engine/src/EngineModule' import AvatarMocapEntry from './examples/avatarMocap' import AvatarTestEntry from './examples/avatarTest' import ComponentExamplesRoute, { subComponentExamples } from './examples/componentExamples/componentExamples' diff --git a/src/sceneRoute.tsx b/src/sceneRoute.tsx index 95e22af..c927f3f 100644 --- a/src/sceneRoute.tsx +++ b/src/sceneRoute.tsx @@ -5,7 +5,7 @@ import React, { useEffect, useRef, useState } from 'react' import { useLoadEngineWithScene, useNetwork } from '@etherealengine/client-core/src/components/World/EngineHooks' import { useLoadScene } from '@etherealengine/client-core/src/components/World/LoadLocationScene' -import '@etherealengine/client-core/src/world/LocationModule' +import '@etherealengine/engine/src/EngineModule' import { Engine, Entity, getComponent, setComponent } from '@etherealengine/ecs' import { GLTFAssetState } from '@etherealengine/engine/src/gltf/GLTFState' import { useHookstate, useImmediateEffect, useMutableState } from '@etherealengine/hyperflux' @@ -13,6 +13,8 @@ import { CameraComponent } from '@etherealengine/spatial/src/camera/components/C import { CameraOrbitComponent } from '@etherealengine/spatial/src/camera/components/CameraOrbitComponent' import { InputComponent } from '@etherealengine/spatial/src/input/components/InputComponent' import { RendererComponent } from '@etherealengine/spatial/src/renderer/WebGLRendererSystem' +import { staticResourcePath } from '@etherealengine/common/src/schema.type.module' +import { useFind } from '@etherealengine/spatial/src/common/functions/FeathersHooks' type Metadata = { name: string @@ -55,16 +57,19 @@ export const useRouteScene = (projectName = 'ee-development-test-suite', sceneNa useLoadScene({ projectName: projectName, sceneName: sceneName }) useNetwork({ online: false }) useLoadEngineWithScene() + const sceneKey = `projects/${projectName}/${sceneName}` + const assetQuery = useFind(staticResourcePath, { query: { key: sceneKey, type: 'scene' } }) const gltfState = useMutableState(GLTFAssetState) const sceneEntity = useHookstate(undefined) useEffect(() => { - const sceneURL = `projects/${projectName}/${sceneName}` + if (!assetQuery.data[0]) return + const sceneURL = assetQuery.data[0].url if (!gltfState[sceneURL].value) return const entity = gltfState[sceneURL].value if (entity) sceneEntity.set(entity) - }, [gltfState]) + }, [assetQuery.data, gltfState]) useImmediateEffect(() => { const entity = Engine.instance.viewerEntity