From 0d6b1b2218fed309dbbce5a9749d665e09347861 Mon Sep 17 00:00:00 2001 From: redenza Date: Thu, 14 Nov 2024 12:23:22 -0500 Subject: [PATCH 1/7] start working on better scene loading pattern --- Artifact/Model/JourneyViewModel.swift | 115 +++++++++++++++++- Artifact/Views/BottomSheetView.swift | 2 +- Artifact/Views/JourneyRealityView.swift | 75 ++++++++---- .../ShaderGraphEditorPluginID | 4 - .../ShaderGraphEditorPluginID | 4 - .../ShaderGraphEditorPluginID | 4 - .../ShaderGraphEditorPluginID | 4 - .../ShaderGraphEditorPluginID | 4 - .../ShaderGraphEditorPluginID | 4 - .../ShaderGraphEditorPluginID | 4 - .../ShaderGraphEditorPluginID | 4 - .../WorkspaceData/redenza.rcuserdata | 2 +- .../Solar/Solar_Mercury.usda | 2 +- 13 files changed, 166 insertions(+), 62 deletions(-) delete mode 100644 Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/080F1D3A-CD06-4A94-9135-2C594D86ABED/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID delete mode 100644 Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/1839D52B-8E44-436B-8828-14E990F14525/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID delete mode 100644 Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/2DA748A8-592E-47CA-8A33-BDD0E34F13AB/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID delete mode 100644 Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/4A0FD71F-DAF4-4683-B49A-E196129C424E/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID delete mode 100644 Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/4D6F21B0-9DE3-4F39-9176-49F4BFCA0E77/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID delete mode 100644 Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/B136744D-6D64-4E4A-8C29-CCB04715F9CE/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID delete mode 100644 Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/E12B69A7-3D60-43A9-B84C-36943B66CF5D/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID delete mode 100644 Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/E49BF78C-ACA0-4276-BC1C-33DFBFAD9F26/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID diff --git a/Artifact/Model/JourneyViewModel.swift b/Artifact/Model/JourneyViewModel.swift index 12f6c3d..62fdf59 100644 --- a/Artifact/Model/JourneyViewModel.swift +++ b/Artifact/Model/JourneyViewModel.swift @@ -1,9 +1,120 @@ import Foundation +import RealityKit +import ArtifactScenes + +enum SceneLoadingState { + case notLoaded + case loading + case loaded + case failed(Error) +} class JourneyViewModel: ObservableObject { @Published var selectedSceneName: String - - init(initialSceneName: String) { + @Published private(set) var sceneLoadingState: SceneLoadingState = .notLoaded + + private var sceneCache: [String: Entity] = [:] + private var preloadTasks: Set> = [] + private let maxCacheSize = 4 + + private var currentIndex: Int = 0 + private var artifacts: [Artifact] = [] + private var journeyPrefix: String = "" + + init(initialSceneName: String, artifacts: [Artifact] = [], journeyPrefix: String = "") { self.selectedSceneName = initialSceneName + self.artifacts = artifacts + self.journeyPrefix = journeyPrefix + + if let initialIndex = artifacts.firstIndex(where: { $0.sceneName == initialSceneName }) { + self.currentIndex = initialIndex + } + } + + func selectScene(named sceneName: String) async { + // Run UI updates on main thread + await MainActor.run { + if let newIndex = artifacts.firstIndex(where: { $0.sceneName == sceneName }) { + currentIndex = newIndex + selectedSceneName = sceneName + } + } + + cancelPreloadTasks() + await loadSelectedAndPreloadNext() + } + + private func loadSelectedAndPreloadNext() async { + // Load current scene if needed + await loadSceneIfNeeded(named: selectedSceneName, priority: .high) + + // Preload next scenes + await preloadUpcomingScenes() + cleanupCache() + } + + private func loadSceneIfNeeded(named sceneName: String, priority: TaskPriority = .medium) async { + guard sceneCache[sceneName] == nil else { return } + + // Update loading state on main thread + await MainActor.run { + sceneLoadingState = .loading + } + + do { + let scene = try await Entity(named: "\(journeyPrefix)/\(journeyPrefix)_\(sceneName)", + in: artifactScenesBundle) + // Cache and update state on main thread + await MainActor.run { + sceneCache[sceneName] = scene + sceneLoadingState = .loaded + } + } catch { + print("Error loading scene \(sceneName): \(error)") + await MainActor.run { + sceneLoadingState = .failed(error) + } + } + } + + private func cancelPreloadTasks() { + preloadTasks.forEach { $0.cancel() } + preloadTasks.removeAll() + } + + private func preloadUpcomingScenes() async { + // Determine next scenes to preload + let upcomingIndices = getUpcomingIndices() + + // Create preload tasks + for index in upcomingIndices { + let sceneName = artifacts[index].sceneName + let task = Task(priority: .low) { + await loadSceneIfNeeded(named: sceneName) + } + preloadTasks.insert(task) + } + } + + private func getUpcomingIndices() -> [Int] { + let nextIndices = (currentIndex + 1)...(currentIndex + 2) + return nextIndices.filter { $0 < artifacts.count } + } + + private func cleanupCache() { + // Keep only current and adjacent models in cache + let keepIndices = Set((max(0, currentIndex - 1)...min(artifacts.count - 1, currentIndex + 2))) + let keepSceneNames = Set(keepIndices.map { artifacts[$0].sceneName }) + + // Remove scenes that are no longer needed + sceneCache = sceneCache.filter { keepSceneNames.contains($0.key) } + } + + func getCachedScene(named sceneName: String) -> Entity? { + return sceneCache[sceneName] + } + + deinit { + cancelPreloadTasks() } } diff --git a/Artifact/Views/BottomSheetView.swift b/Artifact/Views/BottomSheetView.swift index e68c42a..e31532d 100644 --- a/Artifact/Views/BottomSheetView.swift +++ b/Artifact/Views/BottomSheetView.swift @@ -48,5 +48,5 @@ struct BottomSheetView: View { } #Preview { - BottomSheetView(sceneName: "Chichen Itza", info: "Once a thriving Maya city, Chichen Itza is home to the iconic El Castillo pyramid, an architectural masterpiece that reveals the Maya’s advanced understanding of astronomy.", viewModel: .init(initialSceneName: "Chichen Itza")) + BottomSheetView(sceneName: "Chichen Itza", info: "Once a thriving Maya city, Chichen Itza is home to the iconic El Castillo pyramid, an architectural masterpiece that reveals the Maya’s advanced understanding of astronomy.", viewModel: .init(initialSceneName: "Chichen Itza", artifacts: [], journeyPrefix: "")) } diff --git a/Artifact/Views/JourneyRealityView.swift b/Artifact/Views/JourneyRealityView.swift index 4b932ad..ed894aa 100644 --- a/Artifact/Views/JourneyRealityView.swift +++ b/Artifact/Views/JourneyRealityView.swift @@ -11,17 +11,17 @@ struct JourneyRealityView: View { @State private var rotation: Float = 0.0 @State private var position: SIMD3 = SIMD3(x: 0, y: 0.3, z: 0) + @State private var anchorEntity: AnchorEntity? + init(_ journey: Journey) { self.journey = journey - let initialSceneName: String - if let firstArtifact = journey.artifacts.first { - initialSceneName = firstArtifact.sceneName - } else { - initialSceneName = "" - } - - _viewModel = StateObject(wrappedValue: JourneyViewModel(initialSceneName: initialSceneName)) + let initialSceneName = journey.artifacts.first?.sceneName ?? "" + _viewModel = StateObject(wrappedValue: JourneyViewModel( + initialSceneName: initialSceneName, + artifacts: journey.artifacts, + journeyPrefix: journey.artifactPrefix + )) } @State private var currentScene: Entity? @@ -29,6 +29,9 @@ struct JourneyRealityView: View { var body: some View { ZStack(alignment: .bottom) { realityView + if case .loading = viewModel.sceneLoadingState { + loadingOverlay + } artifactSheets } } @@ -36,23 +39,17 @@ struct JourneyRealityView: View { var realityView: some View { RealityView { content in content.camera = .spatialTracking - if let scene = currentScene { - content.add(scene) - } - } update: { content in - content.entities.removeAll() - if let scene = currentScene { - content.add(scene) - } - } - .onAppear { + let anchor = AnchorEntity(plane: .horizontal, classification: .floor) + anchor.position = position + content.add(anchor) + anchorEntity = anchor + Task { - await loadScene(named: viewModel.selectedSceneName) + await viewModel.selectScene(named: viewModel.selectedSceneName) } - } - .onChange(of: viewModel.selectedSceneName) { + } update: { content in Task { - await loadScene(named: viewModel.selectedSceneName) + await updateScene() } } .gesture(scaleGesture) @@ -64,6 +61,15 @@ struct JourneyRealityView: View { .ignoresSafeArea() } + var loadingOverlay: some View { + VStack { + ProgressView() + Text("Loading model...") + } + .frame(maxWidth: .infinity, maxHeight: .infinity) + .background(Color.black.opacity(0.3)) + } + var artifactSheets: some View { ScrollView(.horizontal, showsIndicators: false) { HStack(spacing: 20) { @@ -128,6 +134,25 @@ struct JourneyRealityView: View { } } + @MainActor + private func updateScene() async { + guard let anchor = anchorEntity else { return } + + anchor.children.removeAll() + + // Get scene from cache + if let scene = viewModel.getCachedScene(named: viewModel.selectedSceneName)?.clone(recursive: true) { + print(scene) + configureScene(scene) + anchor.addChild(scene) + } + } + + private func configureScene(_ scene: Entity) { + scene.scale = [scale, scale, scale] + scene.orientation = simd_quatf(angle: rotation, axis: SIMD3(0, 1, 0)) + } + @MainActor private func loadScene(named sceneName: String) async { do { @@ -156,6 +181,6 @@ struct JourneyRealityView: View { } } -#Preview { - JourneyRealityView(Journey.sampleJourneys[1]) -} +//#Preview { +// JourneyRealityView(Journey.sampleJourneys[1]) +//} diff --git a/Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/080F1D3A-CD06-4A94-9135-2C594D86ABED/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID b/Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/080F1D3A-CD06-4A94-9135-2C594D86ABED/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID deleted file mode 100644 index 30e4dd4..0000000 --- a/Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/080F1D3A-CD06-4A94-9135-2C594D86ABED/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID +++ /dev/null @@ -1,4 +0,0 @@ -{ - "materialPreviewEnvironmentType" : 2, - "materialPreviewObjectType" : 0 -} \ No newline at end of file diff --git a/Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/1839D52B-8E44-436B-8828-14E990F14525/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID b/Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/1839D52B-8E44-436B-8828-14E990F14525/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID deleted file mode 100644 index 30e4dd4..0000000 --- a/Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/1839D52B-8E44-436B-8828-14E990F14525/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID +++ /dev/null @@ -1,4 +0,0 @@ -{ - "materialPreviewEnvironmentType" : 2, - "materialPreviewObjectType" : 0 -} \ No newline at end of file diff --git a/Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/2DA748A8-592E-47CA-8A33-BDD0E34F13AB/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID b/Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/2DA748A8-592E-47CA-8A33-BDD0E34F13AB/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID deleted file mode 100644 index 30e4dd4..0000000 --- a/Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/2DA748A8-592E-47CA-8A33-BDD0E34F13AB/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID +++ /dev/null @@ -1,4 +0,0 @@ -{ - "materialPreviewEnvironmentType" : 2, - "materialPreviewObjectType" : 0 -} \ No newline at end of file diff --git a/Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/4A0FD71F-DAF4-4683-B49A-E196129C424E/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID b/Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/4A0FD71F-DAF4-4683-B49A-E196129C424E/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID deleted file mode 100644 index 30e4dd4..0000000 --- a/Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/4A0FD71F-DAF4-4683-B49A-E196129C424E/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID +++ /dev/null @@ -1,4 +0,0 @@ -{ - "materialPreviewEnvironmentType" : 2, - "materialPreviewObjectType" : 0 -} \ No newline at end of file diff --git a/Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/4D6F21B0-9DE3-4F39-9176-49F4BFCA0E77/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID b/Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/4D6F21B0-9DE3-4F39-9176-49F4BFCA0E77/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID deleted file mode 100644 index 30e4dd4..0000000 --- a/Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/4D6F21B0-9DE3-4F39-9176-49F4BFCA0E77/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID +++ /dev/null @@ -1,4 +0,0 @@ -{ - "materialPreviewEnvironmentType" : 2, - "materialPreviewObjectType" : 0 -} \ No newline at end of file diff --git a/Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/B136744D-6D64-4E4A-8C29-CCB04715F9CE/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID b/Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/B136744D-6D64-4E4A-8C29-CCB04715F9CE/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID deleted file mode 100644 index 30e4dd4..0000000 --- a/Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/B136744D-6D64-4E4A-8C29-CCB04715F9CE/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID +++ /dev/null @@ -1,4 +0,0 @@ -{ - "materialPreviewEnvironmentType" : 2, - "materialPreviewObjectType" : 0 -} \ No newline at end of file diff --git a/Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/E12B69A7-3D60-43A9-B84C-36943B66CF5D/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID b/Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/E12B69A7-3D60-43A9-B84C-36943B66CF5D/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID deleted file mode 100644 index 30e4dd4..0000000 --- a/Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/E12B69A7-3D60-43A9-B84C-36943B66CF5D/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID +++ /dev/null @@ -1,4 +0,0 @@ -{ - "materialPreviewEnvironmentType" : 2, - "materialPreviewObjectType" : 0 -} \ No newline at end of file diff --git a/Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/E49BF78C-ACA0-4276-BC1C-33DFBFAD9F26/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID b/Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/E49BF78C-ACA0-4276-BC1C-33DFBFAD9F26/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID deleted file mode 100644 index 30e4dd4..0000000 --- a/Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/E49BF78C-ACA0-4276-BC1C-33DFBFAD9F26/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID +++ /dev/null @@ -1,4 +0,0 @@ -{ - "materialPreviewEnvironmentType" : 2, - "materialPreviewObjectType" : 0 -} \ No newline at end of file diff --git a/Packages/ArtifactScenes/Package.realitycomposerpro/WorkspaceData/redenza.rcuserdata b/Packages/ArtifactScenes/Package.realitycomposerpro/WorkspaceData/redenza.rcuserdata index 42c2733..42c9d86 100644 --- a/Packages/ArtifactScenes/Package.realitycomposerpro/WorkspaceData/redenza.rcuserdata +++ b/Packages/ArtifactScenes/Package.realitycomposerpro/WorkspaceData/redenza.rcuserdata @@ -1238,5 +1238,5 @@ "sceneViewportBackgroundColors" : { }, - "selectedSceneRelativePath" : "Solar\/Solar_Venus.usda" + "selectedSceneRelativePath" : "Solar\/Solar_Mercury.usda" } \ No newline at end of file diff --git a/Packages/ArtifactScenes/Sources/ArtifactScenes/ArtifactScenes.rkassets/Solar/Solar_Mercury.usda b/Packages/ArtifactScenes/Sources/ArtifactScenes/ArtifactScenes.rkassets/Solar/Solar_Mercury.usda index aaa99bc..93202d6 100644 --- a/Packages/ArtifactScenes/Sources/ArtifactScenes/ArtifactScenes.rkassets/Solar/Solar_Mercury.usda +++ b/Packages/ArtifactScenes/Sources/ArtifactScenes/ArtifactScenes.rkassets/Solar/Solar_Mercury.usda @@ -15,7 +15,7 @@ def Xform "Root" prepend references = @Mercury.usdz@ ) { - float3 xformOp:scale = (0.003, 0.003, 0.003) + float3 xformOp:scale = (0.001, 0.001, 0.001) float3 xformOp:translate = (0, 0.25, 0) uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] } From 396dc9baf53a27aa53453ea5efab328acdb8a33e Mon Sep 17 00:00:00 2001 From: redenza Date: Thu, 14 Nov 2024 12:28:23 -0500 Subject: [PATCH 2/7] switch scene using viewModel selectScene when tapping bottom sheet, to fix issue with loading beyond initial preloaded scenes --- Artifact/Views/BottomSheetView.swift | 4 +++- Artifact/Views/JourneyRealityView.swift | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Artifact/Views/BottomSheetView.swift b/Artifact/Views/BottomSheetView.swift index e31532d..3652018 100644 --- a/Artifact/Views/BottomSheetView.swift +++ b/Artifact/Views/BottomSheetView.swift @@ -8,7 +8,9 @@ struct BottomSheetView: View { var body: some View { Button(action: { - viewModel.selectedSceneName = sceneName + Task { + await viewModel.selectScene(named: sceneName) + } }) { VStack { HStack { diff --git a/Artifact/Views/JourneyRealityView.swift b/Artifact/Views/JourneyRealityView.swift index ed894aa..6e2d87b 100644 --- a/Artifact/Views/JourneyRealityView.swift +++ b/Artifact/Views/JourneyRealityView.swift @@ -142,7 +142,6 @@ struct JourneyRealityView: View { // Get scene from cache if let scene = viewModel.getCachedScene(named: viewModel.selectedSceneName)?.clone(recursive: true) { - print(scene) configureScene(scene) anchor.addChild(scene) } From a912592bfd2bbd6f440360b59854e2631742b41c Mon Sep 17 00:00:00 2001 From: redenza Date: Thu, 14 Nov 2024 12:37:13 -0500 Subject: [PATCH 3/7] remove old currentScene var to fix gesture references --- Artifact/Views/JourneyRealityView.swift | 47 +++++++++++++------------ 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/Artifact/Views/JourneyRealityView.swift b/Artifact/Views/JourneyRealityView.swift index 6e2d87b..0f05d73 100644 --- a/Artifact/Views/JourneyRealityView.swift +++ b/Artifact/Views/JourneyRealityView.swift @@ -90,12 +90,13 @@ struct JourneyRealityView: View { let newScale = scale + delta let constrainedScale = min(max(newScale, 0.1), 3.0) - if let anchor = currentScene { - anchor.children.first?.scale = [constrainedScale, constrainedScale, constrainedScale] + if let anchor = anchorEntity, + let model = anchor.children.first { + model.scale = [constrainedScale, constrainedScale, constrainedScale] } } .onEnded { _ in - if let anchor = currentScene, + if let anchor = anchorEntity, let currentScale = anchor.children.first?.scale.x { scale = currentScale } @@ -106,8 +107,9 @@ struct JourneyRealityView: View { RotationGesture() .onChanged { angle in let newRotation = Float(angle.radians) + rotation - if let anchor = currentScene { - anchor.children.first?.orientation = simd_quatf(angle: newRotation, axis: SIMD3(0, 1, 0)) + if let anchor = anchorEntity, + let model = anchor.children.first { + model.orientation = simd_quatf(angle: newRotation, axis: SIMD3(0, 1, 0)) } } .onEnded { angle in @@ -120,20 +122,33 @@ struct JourneyRealityView: View { DragGesture() .onChanged { value in let translation = value.translation - let newX = position.x + Float(translation.width) * 0.005 - let newZ = position.z + Float(translation.height) * 0.005 + let newX = position.x + Float(translation.width) * 0.003 + let newZ = position.z + Float(translation.height) * 0.003 - if let anchor = currentScene { + if let anchor = anchorEntity { anchor.position = SIMD3(x: newX, y: position.y, z: newZ) } } .onEnded { _ in - if let anchor = currentScene { + if let anchor = anchorEntity { position = anchor.position } } } + private func resetScene() { + scale = 1.0 + rotation = 0.0 + position = SIMD3(x: 0, y: 0.3, z: 0) + + if let anchor = anchorEntity, + let model = anchor.children.first { + anchor.position = position + model.scale = [scale, scale, scale] + model.orientation = simd_quatf(angle: rotation, axis: SIMD3(0, 1, 0)) + } + } + @MainActor private func updateScene() async { guard let anchor = anchorEntity else { return } @@ -164,20 +179,6 @@ struct JourneyRealityView: View { print("Error loading scene \(sceneName): \(error)") } } - - private func resetScene() { - scale = 1.0 - rotation = 0.0 - position = SIMD3(x: 0, y: 0.3, z: 0) - - if let anchor = currentScene { - anchor.position = position - if let model = anchor.children.first { - model.scale = [scale, scale, scale] - model.orientation = simd_quatf(angle: rotation, axis: SIMD3(0, 1, 0)) - } - } - } } //#Preview { From b2ebd69105449d41c2b55f5c613042c5aa2408b2 Mon Sep 17 00:00:00 2001 From: redenza Date: Sat, 16 Nov 2024 16:08:44 -0500 Subject: [PATCH 4/7] start making fetch calls to get journey data from aws api --- ...el.swift => ArtifactScenesViewModel.swift} | 2 +- Artifact/Model/DataModels.swift | 11 +++++---- Artifact/Model/JourneyService.swift | 13 ++++++++++ Artifact/Model/JourneysViewModel.swift | 24 +++++++++++++++++++ Artifact/Views/BottomSheetView.swift | 2 +- Artifact/Views/ContentView.swift | 7 +++++- Artifact/Views/JourneyRealityView.swift | 19 ++------------- 7 files changed, 53 insertions(+), 25 deletions(-) rename Artifact/Model/{JourneyViewModel.swift => ArtifactScenesViewModel.swift} (98%) create mode 100644 Artifact/Model/JourneyService.swift create mode 100644 Artifact/Model/JourneysViewModel.swift diff --git a/Artifact/Model/JourneyViewModel.swift b/Artifact/Model/ArtifactScenesViewModel.swift similarity index 98% rename from Artifact/Model/JourneyViewModel.swift rename to Artifact/Model/ArtifactScenesViewModel.swift index 62fdf59..589951a 100644 --- a/Artifact/Model/JourneyViewModel.swift +++ b/Artifact/Model/ArtifactScenesViewModel.swift @@ -9,7 +9,7 @@ enum SceneLoadingState { case failed(Error) } -class JourneyViewModel: ObservableObject { +class ArtifactScenesViewModel: ObservableObject { @Published var selectedSceneName: String @Published private(set) var sceneLoadingState: SceneLoadingState = .notLoaded diff --git a/Artifact/Model/DataModels.swift b/Artifact/Model/DataModels.swift index 9fdb5fc..965df5c 100644 --- a/Artifact/Model/DataModels.swift +++ b/Artifact/Model/DataModels.swift @@ -1,19 +1,20 @@ -struct Journey { +struct Journey: Codable, Identifiable { let imageUrl: String let title: String let description: String let artifactPrefix: String let artifacts: [Artifact] + var id: String { title } + static let sampleJourneys = [ Journey(imageUrl: "https://artifact-ios.s3.us-east-2.amazonaws.com/7.jpg", title: "7 wonders", description: "Embark on a journey to explore the legendary New 7 Wonders of the World, marvels that span continents and time. From the ancient walls that stretch across China to the towering statue overlooking Rio, each wonder tells a story of human achievement and cultural legacy. Encounter the architectural splendor of Petra, the timeless beauty of the Taj Mahal, and the majestic terraces of Machu Picchu. Stand before the enduring grandeur of Chichen Itza and the epic arches of the Roman Colosseum. This journey isn’t just about visiting places—it’s a path through history, mystery, and the extraordinary tales behind the world’s most iconic structures. Let each wonder inspire awe, ignite curiosity, and deepen your connection to the world’s shared heritage.", artifactPrefix: "7", artifacts: [Artifact(sceneName: "Colosseum", info: "This ancient amphitheater in Rome hosted gladiator battles and public spectacles, embodying the grandeur of Roman engineering and the era’s complex social life."), Artifact(sceneName: "Great_Wall", info: "A massive architectural feat, the Great Wall stretches thousands of miles across northern China, originally built to protect against invasions and now a symbol of resilience and history."), Artifact(sceneName: "Petra", info: "Known as the “Rose City” for its pink sandstone cliffs, Petra is an ancient city carved into rock, showcasing the Nabatean civilization's architectural and engineering prowess."),Artifact(sceneName: "Christ_the_Redeemer", info: "Towering above Rio de Janeiro, this colossal statue of Jesus Christ stands with open arms, symbolizing peace, protection, and a warm welcome to visitors from all over the world."), Artifact(sceneName: "Machu_Picchu", info: "Nestled high in the Andes, this Inca citadel is a marvel of ancient engineering, blending seamlessly with the rugged mountain landscape and offering insights into a lost civilization."), Artifact(sceneName: "Taj_Mahal", info: "Built as a monument of love, the Taj Mahal is a stunning marble mausoleum with intricate inlay work, gardens, and symmetry, reflecting the beauty and devotion of the Mughal era."), Artifact(sceneName: "Chichen_Itza", info: "Once a thriving Maya city, Chichen Itza is home to the iconic El Castillo pyramid, an architectural masterpiece that reveals the Maya’s advanced understanding of astronomy.")]), Journey(imageUrl: "https://artifact-ios.s3.us-east-2.amazonaws.com/solar-system.jpg", title: "Solar System", description: "Embark on a journey across the vast expanses of our solar system, where each planet holds unique mysteries and characteristics. From the fiery surface of Mercury to the distant, icy reaches of Neptune, explore the wonders orbiting our Sun. Glide past the swirling clouds of Jupiter, marvel at the rings of Saturn, and witness the vibrant landscapes of Mars. This journey invites you to experience the solar system’s scale, diversity, and the celestial beauty that lies beyond Earth, connecting us to the greater cosmos with every orbit.", artifactPrefix: "Solar", artifacts: [Artifact(sceneName: "Mercury", info: "The smallest planet and closest to the Sun, Mercury has extreme temperature shifts and a cratered surface, resembling Earth’s moon in appearance."), Artifact(sceneName: "Venus", info: "Often called Earth’s “sister planet” due to its similar size, Venus has a thick, toxic atmosphere and surface temperatures hot enough to melt lead."), Artifact(sceneName: "Earth", info: "The only planet known to support life, Earth has diverse ecosystems, abundant water, and a dynamic climate, making it uniquely habitable."), Artifact(sceneName: "Mars", info: "Known as the “Red Planet” for its rusty surface, Mars has vast deserts, canyons, and polar ice caps, and continues to intrigue scientists with the possibility of past water."), Artifact(sceneName: "Jupiter", info: "The largest planet, Jupiter is a gas giant with powerful storms, including the iconic Great Red Spot, and dozens of moons, making it a mini solar system."), Artifact(sceneName: "Saturn", info: "Famous for its stunning ring system, Saturn is a gas giant with a unique atmosphere and many moons, including Titan, which has its own weather patterns."), Artifact(sceneName: "Uranus", info: "Known for its unusual tilt, Uranus orbits the Sun on its side, has faint rings, and displays a pale blue color due to its icy atmosphere."), Artifact(sceneName: "Neptune", info: "The windiest planet in the solar system, Neptune is a deep blue gas giant with faint rings and a distant, cold orbit that marks the edge of the known planets.")])] } -struct Artifact: Identifiable { +struct Artifact: Identifiable, Codable { let sceneName: String let info: String - var id: String { - sceneName - } + + var id: String { sceneName } } diff --git a/Artifact/Model/JourneyService.swift b/Artifact/Model/JourneyService.swift new file mode 100644 index 0000000..43adac0 --- /dev/null +++ b/Artifact/Model/JourneyService.swift @@ -0,0 +1,13 @@ +import Foundation + +class JourneyService { + private let apiURL = "https://gn4xt2b916.execute-api.us-east-2.amazonaws.com/prod/journeys" + private let apiKey = "tP731AxMWA61ISM5XIaUf3XSdLQf8n3EnC8Jc660" // throttled, so ok to be public + + func fetchJourneys() async throws -> [Journey] { + var request = URLRequest(url: URL(string: apiURL)!) + request.setValue(apiKey, forHTTPHeaderField: "x-api-key") + let (data, _) = try await URLSession.shared.data(for: request) + return try JSONDecoder().decode([Journey].self, from: data) + } +} diff --git a/Artifact/Model/JourneysViewModel.swift b/Artifact/Model/JourneysViewModel.swift new file mode 100644 index 0000000..36f4d9d --- /dev/null +++ b/Artifact/Model/JourneysViewModel.swift @@ -0,0 +1,24 @@ +import Foundation + +@MainActor +class JourneysViewModel: ObservableObject { + @Published var journeys: [Journey] = [] + @Published var isLoading = false + @Published var error: Error? + + private let service = JourneyService() + + func loadJourneys() { + isLoading = true + + Task { + do { + journeys = try await service.fetchJourneys() + } catch { + self.error = error + } + isLoading = false + } + } +} + diff --git a/Artifact/Views/BottomSheetView.swift b/Artifact/Views/BottomSheetView.swift index 3652018..f697dbc 100644 --- a/Artifact/Views/BottomSheetView.swift +++ b/Artifact/Views/BottomSheetView.swift @@ -3,7 +3,7 @@ import SwiftUI struct BottomSheetView: View { let sceneName: String let info: String - @ObservedObject var viewModel: JourneyViewModel + @ObservedObject var viewModel: ArtifactScenesViewModel @State private var showingDetail = false var body: some View { diff --git a/Artifact/Views/ContentView.swift b/Artifact/Views/ContentView.swift index 54bedc7..56bf2ee 100644 --- a/Artifact/Views/ContentView.swift +++ b/Artifact/Views/ContentView.swift @@ -1,11 +1,13 @@ import SwiftUI struct ContentView: View { + @StateObject private var journeysViewModel = JourneysViewModel() + var body: some View { NavigationView { ScrollView { VStack(alignment: .leading, spacing: 16) { - ForEach(Journey.sampleJourneys, id: \.self.title) { journey in + ForEach(journeysViewModel.journeys, id: \.self.title) { journey in NavigationLink(destination: JourneyDetailView(journey)) { JourneyCardView(journey) } @@ -15,6 +17,9 @@ struct ContentView: View { .padding() } } + .onAppear { + journeysViewModel.loadJourneys() + } } } diff --git a/Artifact/Views/JourneyRealityView.swift b/Artifact/Views/JourneyRealityView.swift index 0f05d73..a08fdd1 100644 --- a/Artifact/Views/JourneyRealityView.swift +++ b/Artifact/Views/JourneyRealityView.swift @@ -6,7 +6,7 @@ import ArtifactScenes struct JourneyRealityView: View { let journey: Journey - @StateObject private var viewModel: JourneyViewModel + @StateObject private var viewModel: ArtifactScenesViewModel @State private var scale: Float = 1.0 @State private var rotation: Float = 0.0 @State private var position: SIMD3 = SIMD3(x: 0, y: 0.3, z: 0) @@ -17,15 +17,13 @@ struct JourneyRealityView: View { self.journey = journey let initialSceneName = journey.artifacts.first?.sceneName ?? "" - _viewModel = StateObject(wrappedValue: JourneyViewModel( + _viewModel = StateObject(wrappedValue: ArtifactScenesViewModel( initialSceneName: initialSceneName, artifacts: journey.artifacts, journeyPrefix: journey.artifactPrefix )) } - @State private var currentScene: Entity? - var body: some View { ZStack(alignment: .bottom) { realityView @@ -166,19 +164,6 @@ struct JourneyRealityView: View { scene.scale = [scale, scale, scale] scene.orientation = simd_quatf(angle: rotation, axis: SIMD3(0, 1, 0)) } - - @MainActor - private func loadScene(named sceneName: String) async { - do { - let scene = try await Entity(named: "\(journey.artifactPrefix)/\(journey.artifactPrefix)_\(sceneName)", in: artifactScenesBundle) - let anchor = AnchorEntity(plane: .horizontal, classification: .floor) - anchor.position = SIMD3(x: 0, y: 0.4, z: 0) - anchor.addChild(scene) - currentScene = anchor - } catch { - print("Error loading scene \(sceneName): \(error)") - } - } } //#Preview { From 5177e4fea1d0351bb9c38fb92e859450a3f33214 Mon Sep 17 00:00:00 2001 From: redenza Date: Sat, 16 Nov 2024 16:56:38 -0500 Subject: [PATCH 5/7] small changes - update view model name and add better loading spinner --- Artifact/Views/JourneyRealityView.swift | 31 ++++++++++--------------- 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/Artifact/Views/JourneyRealityView.swift b/Artifact/Views/JourneyRealityView.swift index a08fdd1..8c8896a 100644 --- a/Artifact/Views/JourneyRealityView.swift +++ b/Artifact/Views/JourneyRealityView.swift @@ -6,7 +6,7 @@ import ArtifactScenes struct JourneyRealityView: View { let journey: Journey - @StateObject private var viewModel: ArtifactScenesViewModel + @StateObject private var artifactScenesViewModel: ArtifactScenesViewModel @State private var scale: Float = 1.0 @State private var rotation: Float = 0.0 @State private var position: SIMD3 = SIMD3(x: 0, y: 0.3, z: 0) @@ -17,7 +17,7 @@ struct JourneyRealityView: View { self.journey = journey let initialSceneName = journey.artifacts.first?.sceneName ?? "" - _viewModel = StateObject(wrappedValue: ArtifactScenesViewModel( + _artifactScenesViewModel = StateObject(wrappedValue: ArtifactScenesViewModel( initialSceneName: initialSceneName, artifacts: journey.artifacts, journeyPrefix: journey.artifactPrefix @@ -27,8 +27,10 @@ struct JourneyRealityView: View { var body: some View { ZStack(alignment: .bottom) { realityView - if case .loading = viewModel.sceneLoadingState { - loadingOverlay + if case .loading = artifactScenesViewModel.sceneLoadingState { + ProgressView() + .progressViewStyle(CircularProgressViewStyle()) + .scaleEffect(2.0) } artifactSheets } @@ -43,7 +45,7 @@ struct JourneyRealityView: View { anchorEntity = anchor Task { - await viewModel.selectScene(named: viewModel.selectedSceneName) + await artifactScenesViewModel.selectScene(named: artifactScenesViewModel.selectedSceneName) } } update: { content in Task { @@ -59,22 +61,13 @@ struct JourneyRealityView: View { .ignoresSafeArea() } - var loadingOverlay: some View { - VStack { - ProgressView() - Text("Loading model...") - } - .frame(maxWidth: .infinity, maxHeight: .infinity) - .background(Color.black.opacity(0.3)) - } - var artifactSheets: some View { ScrollView(.horizontal, showsIndicators: false) { HStack(spacing: 20) { ForEach(journey.artifacts) { artifact in BottomSheetView(sceneName: artifact.sceneName, info: artifact.info, - viewModel: viewModel) + viewModel: artifactScenesViewModel) } } .padding(.horizontal, 20) @@ -154,7 +147,7 @@ struct JourneyRealityView: View { anchor.children.removeAll() // Get scene from cache - if let scene = viewModel.getCachedScene(named: viewModel.selectedSceneName)?.clone(recursive: true) { + if let scene = artifactScenesViewModel.getCachedScene(named: artifactScenesViewModel.selectedSceneName)?.clone(recursive: true) { configureScene(scene) anchor.addChild(scene) } @@ -166,6 +159,6 @@ struct JourneyRealityView: View { } } -//#Preview { -// JourneyRealityView(Journey.sampleJourneys[1]) -//} +#Preview { + JourneyRealityView(Journey.sampleJourneys[1]) +} From 329b2f9e5889e5b24bd45604be181ebe6c873cf0 Mon Sep 17 00:00:00 2001 From: redenza Date: Sat, 16 Nov 2024 17:10:41 -0500 Subject: [PATCH 6/7] make taj mahal model smaller --- .../ShaderGraphEditorPluginID | 4 + .../ShaderGraphEditorPluginID | 4 + .../ShaderGraphEditorPluginID | 4 + .../ShaderGraphEditorPluginID | 4 + .../ShaderGraphEditorPluginID | 4 + .../ShaderGraphEditorPluginID | 4 + .../ShaderGraphEditorPluginID | 4 + .../ShaderGraphEditorPluginID | 4 + .../ShaderGraphEditorPluginID | 4 + .../ShaderGraphEditorPluginID | 4 + .../WorkspaceData/SceneMetadataList.json | 9 + .../WorkspaceData/redenza.rcuserdata | 288 ++++++++++-------- .../7/7_Taj_Mahal.usda | 5 +- 13 files changed, 208 insertions(+), 134 deletions(-) create mode 100644 Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/07037D7F-89AB-4FBF-A528-7B7D1013B713/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID create mode 100644 Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/080F1D3A-CD06-4A94-9135-2C594D86ABED/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID create mode 100644 Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/1839D52B-8E44-436B-8828-14E990F14525/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID create mode 100644 Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/2DA748A8-592E-47CA-8A33-BDD0E34F13AB/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID create mode 100644 Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/4A0FD71F-DAF4-4683-B49A-E196129C424E/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID create mode 100644 Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/4D6F21B0-9DE3-4F39-9176-49F4BFCA0E77/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID create mode 100644 Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/B136744D-6D64-4E4A-8C29-CCB04715F9CE/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID create mode 100644 Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/E12B69A7-3D60-43A9-B84C-36943B66CF5D/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID create mode 100644 Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/E2C6AE17-1719-4283-8EA0-553586E5C510/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID create mode 100644 Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/E49BF78C-ACA0-4276-BC1C-33DFBFAD9F26/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID diff --git a/Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/07037D7F-89AB-4FBF-A528-7B7D1013B713/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID b/Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/07037D7F-89AB-4FBF-A528-7B7D1013B713/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID new file mode 100644 index 0000000..30e4dd4 --- /dev/null +++ b/Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/07037D7F-89AB-4FBF-A528-7B7D1013B713/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID @@ -0,0 +1,4 @@ +{ + "materialPreviewEnvironmentType" : 2, + "materialPreviewObjectType" : 0 +} \ No newline at end of file diff --git a/Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/080F1D3A-CD06-4A94-9135-2C594D86ABED/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID b/Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/080F1D3A-CD06-4A94-9135-2C594D86ABED/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID new file mode 100644 index 0000000..30e4dd4 --- /dev/null +++ b/Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/080F1D3A-CD06-4A94-9135-2C594D86ABED/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID @@ -0,0 +1,4 @@ +{ + "materialPreviewEnvironmentType" : 2, + "materialPreviewObjectType" : 0 +} \ No newline at end of file diff --git a/Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/1839D52B-8E44-436B-8828-14E990F14525/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID b/Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/1839D52B-8E44-436B-8828-14E990F14525/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID new file mode 100644 index 0000000..30e4dd4 --- /dev/null +++ b/Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/1839D52B-8E44-436B-8828-14E990F14525/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID @@ -0,0 +1,4 @@ +{ + "materialPreviewEnvironmentType" : 2, + "materialPreviewObjectType" : 0 +} \ No newline at end of file diff --git a/Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/2DA748A8-592E-47CA-8A33-BDD0E34F13AB/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID b/Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/2DA748A8-592E-47CA-8A33-BDD0E34F13AB/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID new file mode 100644 index 0000000..30e4dd4 --- /dev/null +++ b/Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/2DA748A8-592E-47CA-8A33-BDD0E34F13AB/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID @@ -0,0 +1,4 @@ +{ + "materialPreviewEnvironmentType" : 2, + "materialPreviewObjectType" : 0 +} \ No newline at end of file diff --git a/Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/4A0FD71F-DAF4-4683-B49A-E196129C424E/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID b/Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/4A0FD71F-DAF4-4683-B49A-E196129C424E/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID new file mode 100644 index 0000000..30e4dd4 --- /dev/null +++ b/Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/4A0FD71F-DAF4-4683-B49A-E196129C424E/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID @@ -0,0 +1,4 @@ +{ + "materialPreviewEnvironmentType" : 2, + "materialPreviewObjectType" : 0 +} \ No newline at end of file diff --git a/Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/4D6F21B0-9DE3-4F39-9176-49F4BFCA0E77/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID b/Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/4D6F21B0-9DE3-4F39-9176-49F4BFCA0E77/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID new file mode 100644 index 0000000..30e4dd4 --- /dev/null +++ b/Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/4D6F21B0-9DE3-4F39-9176-49F4BFCA0E77/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID @@ -0,0 +1,4 @@ +{ + "materialPreviewEnvironmentType" : 2, + "materialPreviewObjectType" : 0 +} \ No newline at end of file diff --git a/Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/B136744D-6D64-4E4A-8C29-CCB04715F9CE/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID b/Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/B136744D-6D64-4E4A-8C29-CCB04715F9CE/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID new file mode 100644 index 0000000..30e4dd4 --- /dev/null +++ b/Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/B136744D-6D64-4E4A-8C29-CCB04715F9CE/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID @@ -0,0 +1,4 @@ +{ + "materialPreviewEnvironmentType" : 2, + "materialPreviewObjectType" : 0 +} \ No newline at end of file diff --git a/Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/E12B69A7-3D60-43A9-B84C-36943B66CF5D/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID b/Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/E12B69A7-3D60-43A9-B84C-36943B66CF5D/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID new file mode 100644 index 0000000..30e4dd4 --- /dev/null +++ b/Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/E12B69A7-3D60-43A9-B84C-36943B66CF5D/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID @@ -0,0 +1,4 @@ +{ + "materialPreviewEnvironmentType" : 2, + "materialPreviewObjectType" : 0 +} \ No newline at end of file diff --git a/Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/E2C6AE17-1719-4283-8EA0-553586E5C510/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID b/Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/E2C6AE17-1719-4283-8EA0-553586E5C510/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID new file mode 100644 index 0000000..30e4dd4 --- /dev/null +++ b/Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/E2C6AE17-1719-4283-8EA0-553586E5C510/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID @@ -0,0 +1,4 @@ +{ + "materialPreviewEnvironmentType" : 2, + "materialPreviewObjectType" : 0 +} \ No newline at end of file diff --git a/Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/E49BF78C-ACA0-4276-BC1C-33DFBFAD9F26/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID b/Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/E49BF78C-ACA0-4276-BC1C-33DFBFAD9F26/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID new file mode 100644 index 0000000..30e4dd4 --- /dev/null +++ b/Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/E49BF78C-ACA0-4276-BC1C-33DFBFAD9F26/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID @@ -0,0 +1,4 @@ +{ + "materialPreviewEnvironmentType" : 2, + "materialPreviewObjectType" : 0 +} \ No newline at end of file diff --git a/Packages/ArtifactScenes/Package.realitycomposerpro/WorkspaceData/SceneMetadataList.json b/Packages/ArtifactScenes/Package.realitycomposerpro/WorkspaceData/SceneMetadataList.json index f35e55c..277f39e 100644 --- a/Packages/ArtifactScenes/Package.realitycomposerpro/WorkspaceData/SceneMetadataList.json +++ b/Packages/ArtifactScenes/Package.realitycomposerpro/WorkspaceData/SceneMetadataList.json @@ -245,6 +245,15 @@ "E2C6AE17-1719-4283-8EA0-553586E5C510", "Root" ], + { + "isExpanded" : true, + "isLocked" : false + }, + [ + "E2C6AE17-1719-4283-8EA0-553586E5C510", + "Root", + "TAJ_MAHAL" + ], { "isExpanded" : true, "isLocked" : false diff --git a/Packages/ArtifactScenes/Package.realitycomposerpro/WorkspaceData/redenza.rcuserdata b/Packages/ArtifactScenes/Package.realitycomposerpro/WorkspaceData/redenza.rcuserdata index 42c9d86..dda59f3 100644 --- a/Packages/ArtifactScenes/Package.realitycomposerpro/WorkspaceData/redenza.rcuserdata +++ b/Packages/ArtifactScenes/Package.realitycomposerpro/WorkspaceData/redenza.rcuserdata @@ -8,7 +8,9 @@ "Solar\/Solar_Neptune.usda", "Solar\/Solar_Saturn.usda", "Solar\/Solar_Uranus.usda", - "Solar\/Solar_Venus.usda" + "Solar\/Solar_Venus.usda", + "7\/7_Taj_Mahal.usda", + "7\/7_Machu_Picchu.usda" ], "recentIdentifiers" : { "922A76D1-888A-4F2C-9417-ECB16E34B94F" : [ @@ -23,6 +25,28 @@ }, "sceneCameraHistory" : { "07037D7F-89AB-4FBF-A528-7B7D1013B713" : [ + { + "date" : 753487492.642127, + "title" : "Untitled", + "transform" : [ + 0.2153632, + 3.1464886e-10, + 0.976534, + 0, + 0.7200083, + 0.67555445, + -0.15878949, + 0, + -0.6597019, + 0.7373102, + 0.14548957, + 0, + -2.0546465, + 2.2963576, + 0.45312828, + 1 + ] + }, { "date" : 753032965.041482, "title" : "Untitled", @@ -1014,222 +1038,222 @@ ], "E2C6AE17-1719-4283-8EA0-553586E5C510" : [ { - "date" : 753032929.662565, + "date" : 753487718.911617, "title" : "Untitled", "transform" : [ - 0.28257015, - -5.6793183e-09, - 0.95924664, + 0.26157922, + 1.0262849e-07, + 0.96518207, 0, - 0.42359832, - 0.89721465, - -0.124781474, + 0.48318908, + 0.8656674, + -0.13095178, 0, - -0.8606501, - 0.44159484, - 0.253526, + -0.8355266, + 0.5006197, + 0.22644058, 0, - -0.86852133, - 0.8153843, - -0.15476753, + -1.778872, + 1.4486784, + 0.79955566, 1 ] }, { - "date" : 753032916.01424, + "date" : 753487715.408803, "title" : "Untitled", "transform" : [ - 0.28257015, - -5.6793183e-09, - 0.95924664, + 0.26157922, + 1.0262849e-07, + 0.96518207, 0, - 0.42359832, - 0.89721465, - -0.124781474, + 0.48318908, + 0.8656674, + -0.13095178, 0, - -0.8606501, - 0.44159484, - 0.253526, + -0.8355266, + 0.5006197, + 0.22644058, 0, - -2.675913, - 2.512198, - -0.47683853, + -0.3679426, + 0.4867766, + 0.16538042, 1 ] }, { - "date" : 753032911.583698, + "date" : 753487603.328946, "title" : "Untitled", "transform" : [ - 0.28257015, - -5.6793183e-09, - 0.95924664, + 0.26157922, + 1.0262849e-07, + 0.96518207, 0, - 0.42359832, - 0.89721465, - -0.124781474, + 0.48318908, + 0.8656674, + -0.13095178, 0, - -0.86065, - 0.44159478, - 0.25352597, + -0.8355266, + 0.5006197, + 0.22644058, 0, - -2.1581385, - 3.514155, - -0.4643576, + -0.3621207, + 0.49720687, + 0.16380262, 1 ] }, { - "date" : 753032906.783503, + "date" : 753487500.932991, "title" : "Untitled", "transform" : [ - 0.977881, - -5.907897e-10, - -0.20916212, + 0.2615793, + 3.0798805e-08, + 0.96518195, 0, - -0.01506389, - 0.9974032, - -0.07042726, + 0.48318902, + 0.86566734, + -0.13095178, 0, - 0.20861886, - 0.07202035, - 0.97534156, + -0.8355266, + 0.50061965, + 0.22644071, 0, - -0.557757, - 2.6937237, - 2.4375308, + -0.4993616, + 0.7780553, + 0.4951496, 1 ] }, { - "date" : 753032477.72616, + "date" : 753487466.063612, "title" : "Untitled", "transform" : [ - 0.977881, - -5.907897e-10, - -0.20916212, + 0.2615793, + 3.0798805e-08, + 0.96518195, 0, - -0.01506389, - 0.9974032, - -0.07042726, + 0.48318902, + 0.86566734, + -0.13095178, 0, - 0.20861886, - 0.07202035, - 0.97534156, + -0.8355266, + 0.50061965, + 0.22644071, 0, - -8.529446, - 8.846262, - 37.275707, + -2.0106728, + 1.6835811, + 0.9047381, 1 ] }, { - "date" : 753032468.116731, + "date" : 753487438.715863, "title" : "Untitled", "transform" : [ - 0.977881, - -5.907897e-10, - -0.20916212, + 0.26157945, + -1.6036553e-08, + 0.96518195, 0, - -0.01506389, - 0.9974032, - -0.07042726, + 0.48318896, + 0.8656674, + -0.13095172, 0, - 0.20861886, - 0.07202035, - 0.97534156, + -0.8355266, + 0.5006197, + 0.22644068, 0, - -2.5761538, - 4.0010166, - 9.981548, + -0.6033592, + 0.67113376, + 0.1431145, 1 ] }, { - "date" : 753032462.411936, + "date" : 753487427.556956, "title" : "Untitled", "transform" : [ - 0.9778809, - -5.9078964e-10, - -0.20916209, + 0.26157945, + -1.6036553e-08, + 0.96518195, 0, - -0.01506389, - 0.9974032, - -0.07042726, + 0.48318896, + 0.8656674, + -0.13095172, 0, - 0.20861886, - 0.07202035, - 0.97534156, + -0.8355266, + 0.5006197, + 0.22644068, 0, - -2.0111713, - 5.078784, - 9.781117, + -0.6751507, + 0.5425141, + 0.1625711, 1 ] }, { - "date" : 753032459.491656, + "date" : 753487422.26754, "title" : "Untitled", "transform" : [ - 0.73360723, - -5.2842477e-09, - 0.67957366, + 0.26157945, + -1.6036553e-08, + 0.96518195, 0, - 0.4639801, - 0.73065054, - -0.5008716, + 0.48318896, + 0.8656674, + -0.13095172, 0, - -0.49653086, - 0.6827517, - 0.53601044, + -0.8355266, + 0.5006197, + 0.22644068, 0, - -5.653422, - 9.636428, - 0.6085546, + -1.3780994, + 0.8617197, + 0.33183575, 1 ] }, { - "date" : 753032452.788111, + "date" : 753487402.977336, "title" : "Untitled", "transform" : [ - 0.73360723, - -5.2842477e-09, - 0.67957366, + 0.26157945, + -1.6036553e-08, + 0.96518195, 0, - 0.4639801, - 0.73065054, - -0.5008716, + 0.48318896, + 0.8656674, + -0.13095172, 0, - -0.49653092, - 0.6827518, - 0.5360105, + -0.8355266, + 0.5006197, + 0.22644068, 0, - -16.015913, - 28.793936, - 1.4359293, + -1.2049747, + 1.1154478, + 0.40968686, 1 ] }, { - "date" : 753032438.799585, + "date" : 753487401.95552, "title" : "Untitled", "transform" : [ - 0.975045, - 6.1047505e-09, - -0.22200707, + 0.26157945, + -1.6036553e-08, + 0.96518195, 0, - -0.01199133, - 0.9985402, - -0.05266535, + 0.48318896, + 0.8656674, + -0.13095172, 0, - 0.22168297, - 0.05401324, - 0.9736217, + -0.8355266, + 0.5006197, + 0.22644068, 0, - 12.582969, - 40.116165, - 55.263817, + -1.2049747, + 1.1154478, + 0.40968686, 1 ] } @@ -1238,5 +1262,5 @@ "sceneViewportBackgroundColors" : { }, - "selectedSceneRelativePath" : "Solar\/Solar_Mercury.usda" + "selectedSceneRelativePath" : "7\/7_Taj_Mahal.usda" } \ No newline at end of file diff --git a/Packages/ArtifactScenes/Sources/ArtifactScenes/ArtifactScenes.rkassets/7/7_Taj_Mahal.usda b/Packages/ArtifactScenes/Sources/ArtifactScenes/ArtifactScenes.rkassets/7/7_Taj_Mahal.usda index c5442eb..49da35c 100644 --- a/Packages/ArtifactScenes/Sources/ArtifactScenes/ArtifactScenes.rkassets/7/7_Taj_Mahal.usda +++ b/Packages/ArtifactScenes/Sources/ArtifactScenes/ArtifactScenes.rkassets/7/7_Taj_Mahal.usda @@ -15,8 +15,9 @@ def Xform "Root" prepend references = @TAJ_MAHAL.usdz@ ) { - float3 xformOp:scale = (0.00001, 0.00001, 0.00001) - float3 xformOp:translate = (0, 0.23593155, 0) + quatf xformOp:orient = (0.99999994, 0, 0, 0) + float3 xformOp:scale = (0.0000060015773, 0.0000060015773, 0.0000060015773) + float3 xformOp:translate = (0, 0.23593156, 0) uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] } } From e95a164b4332a8f9af4f1181defb0f8fe72c2376 Mon Sep 17 00:00:00 2001 From: redenza Date: Sun, 17 Nov 2024 12:06:35 -0500 Subject: [PATCH 7/7] use UserDefaults to persist Journey progress (how many Artifacts have been viewed in that Journey so far) --- Artifact/Model/ArtifactScenesViewModel.swift | 8 +++ Artifact/Model/JourneyProgressManager.swift | 18 +++++++ Artifact/Views/BottomSheetView.swift | 3 ++ Artifact/Views/JourneyDetailView.swift | 52 ++++++++++++------- .../ShaderGraphEditorPluginID | 4 -- .../ShaderGraphEditorPluginID | 4 -- .../ShaderGraphEditorPluginID | 4 -- .../ShaderGraphEditorPluginID | 4 -- .../ShaderGraphEditorPluginID | 4 -- .../ShaderGraphEditorPluginID | 4 -- .../ShaderGraphEditorPluginID | 4 -- .../ShaderGraphEditorPluginID | 4 -- .../ShaderGraphEditorPluginID | 4 -- .../ShaderGraphEditorPluginID | 4 -- 14 files changed, 61 insertions(+), 60 deletions(-) create mode 100644 Artifact/Model/JourneyProgressManager.swift delete mode 100644 Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/07037D7F-89AB-4FBF-A528-7B7D1013B713/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID delete mode 100644 Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/080F1D3A-CD06-4A94-9135-2C594D86ABED/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID delete mode 100644 Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/1839D52B-8E44-436B-8828-14E990F14525/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID delete mode 100644 Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/2DA748A8-592E-47CA-8A33-BDD0E34F13AB/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID delete mode 100644 Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/4A0FD71F-DAF4-4683-B49A-E196129C424E/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID delete mode 100644 Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/4D6F21B0-9DE3-4F39-9176-49F4BFCA0E77/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID delete mode 100644 Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/B136744D-6D64-4E4A-8C29-CCB04715F9CE/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID delete mode 100644 Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/E12B69A7-3D60-43A9-B84C-36943B66CF5D/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID delete mode 100644 Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/E2C6AE17-1719-4283-8EA0-553586E5C510/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID delete mode 100644 Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/E49BF78C-ACA0-4276-BC1C-33DFBFAD9F26/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID diff --git a/Artifact/Model/ArtifactScenesViewModel.swift b/Artifact/Model/ArtifactScenesViewModel.swift index 589951a..3873391 100644 --- a/Artifact/Model/ArtifactScenesViewModel.swift +++ b/Artifact/Model/ArtifactScenesViewModel.swift @@ -17,6 +17,8 @@ class ArtifactScenesViewModel: ObservableObject { private var preloadTasks: Set> = [] private let maxCacheSize = 4 + private let journeyProgressManager = JourneyProgressManager() + private var currentIndex: Int = 0 private var artifacts: [Artifact] = [] private var journeyPrefix: String = "" @@ -42,6 +44,12 @@ class ArtifactScenesViewModel: ObservableObject { cancelPreloadTasks() await loadSelectedAndPreloadNext() + + // if the scene loaded successfully, + // mark it as viewed in UserDefaults + if case .loaded = sceneLoadingState { + journeyProgressManager.markArtifactViewed(journeyPrefix: journeyPrefix, artifactName: sceneName) + } } private func loadSelectedAndPreloadNext() async { diff --git a/Artifact/Model/JourneyProgressManager.swift b/Artifact/Model/JourneyProgressManager.swift new file mode 100644 index 0000000..b4b38da --- /dev/null +++ b/Artifact/Model/JourneyProgressManager.swift @@ -0,0 +1,18 @@ +import Foundation + +class JourneyProgressManager { + private let defaults = UserDefaults.standard + private let viewedArtifactsKey = "viewedArtifacts" + + func getViewedArtifacts(for journeyPrefix: String) -> Set { + let key = "\(viewedArtifactsKey)_\(journeyPrefix)" + return Set(defaults.stringArray(forKey: key) ?? []) + } + + func markArtifactViewed(journeyPrefix: String, artifactName: String) { + let key = "\(viewedArtifactsKey)_\(journeyPrefix)" + var viewed = getViewedArtifacts(for: journeyPrefix) + viewed.insert(artifactName) + defaults.set(Array(viewed), forKey: key) + } +} diff --git a/Artifact/Views/BottomSheetView.swift b/Artifact/Views/BottomSheetView.swift index f697dbc..89bf6db 100644 --- a/Artifact/Views/BottomSheetView.swift +++ b/Artifact/Views/BottomSheetView.swift @@ -3,6 +3,9 @@ import SwiftUI struct BottomSheetView: View { let sceneName: String let info: String + + let journeyProgressManager = JourneyProgressManager() + @ObservedObject var viewModel: ArtifactScenesViewModel @State private var showingDetail = false diff --git a/Artifact/Views/JourneyDetailView.swift b/Artifact/Views/JourneyDetailView.swift index d81d0b1..5caa103 100644 --- a/Artifact/Views/JourneyDetailView.swift +++ b/Artifact/Views/JourneyDetailView.swift @@ -2,35 +2,47 @@ import SwiftUI struct JourneyDetailView: View { let journey: Journey + let journeyProgressManager = JourneyProgressManager() + + @State private var viewedArtifactsCount: Int = 0 init(_ journey: Journey) { self.journey = journey } var body: some View { - ScrollView { - VStack(alignment: .leading, spacing: 16) { - headerContent - - NavigationLink(destination: JourneyRealityView(journey)) { - Text("Start Journey") - .font(.headline) - .frame(maxWidth: .infinity) - .padding() - .background(Color.blue) - .foregroundColor(.white) - .cornerRadius(10) - .padding(.horizontal) - } - .padding(.vertical, 8) - - Text(journey.description) - .font(.body) + ScrollView { + VStack(alignment: .leading, spacing: 16) { + headerContent + + Text("\(viewedArtifactsCount)/\(journey.artifacts.count) Artifacts discovered") + .font(.subheadline) + .foregroundColor(.secondary) + .padding(.horizontal) + + NavigationLink(destination: JourneyRealityView(journey)) { + Text("Start Journey") + .font(.headline) + .frame(maxWidth: .infinity) + .padding() + .background(Color.blue) + .foregroundColor(.white) + .cornerRadius(10) .padding(.horizontal) } - .padding() + .padding(.vertical, 8) + + Text(journey.description) + .font(.body) + .padding(.horizontal) } - .navigationTitle(journey.title) + .padding() + } + .onAppear { + viewedArtifactsCount = journeyProgressManager.getViewedArtifacts(for: journey.artifactPrefix).count + } + .navigationTitle(journey.title) + } @ViewBuilder diff --git a/Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/07037D7F-89AB-4FBF-A528-7B7D1013B713/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID b/Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/07037D7F-89AB-4FBF-A528-7B7D1013B713/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID deleted file mode 100644 index 30e4dd4..0000000 --- a/Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/07037D7F-89AB-4FBF-A528-7B7D1013B713/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID +++ /dev/null @@ -1,4 +0,0 @@ -{ - "materialPreviewEnvironmentType" : 2, - "materialPreviewObjectType" : 0 -} \ No newline at end of file diff --git a/Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/080F1D3A-CD06-4A94-9135-2C594D86ABED/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID b/Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/080F1D3A-CD06-4A94-9135-2C594D86ABED/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID deleted file mode 100644 index 30e4dd4..0000000 --- a/Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/080F1D3A-CD06-4A94-9135-2C594D86ABED/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID +++ /dev/null @@ -1,4 +0,0 @@ -{ - "materialPreviewEnvironmentType" : 2, - "materialPreviewObjectType" : 0 -} \ No newline at end of file diff --git a/Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/1839D52B-8E44-436B-8828-14E990F14525/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID b/Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/1839D52B-8E44-436B-8828-14E990F14525/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID deleted file mode 100644 index 30e4dd4..0000000 --- a/Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/1839D52B-8E44-436B-8828-14E990F14525/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID +++ /dev/null @@ -1,4 +0,0 @@ -{ - "materialPreviewEnvironmentType" : 2, - "materialPreviewObjectType" : 0 -} \ No newline at end of file diff --git a/Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/2DA748A8-592E-47CA-8A33-BDD0E34F13AB/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID b/Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/2DA748A8-592E-47CA-8A33-BDD0E34F13AB/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID deleted file mode 100644 index 30e4dd4..0000000 --- a/Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/2DA748A8-592E-47CA-8A33-BDD0E34F13AB/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID +++ /dev/null @@ -1,4 +0,0 @@ -{ - "materialPreviewEnvironmentType" : 2, - "materialPreviewObjectType" : 0 -} \ No newline at end of file diff --git a/Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/4A0FD71F-DAF4-4683-B49A-E196129C424E/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID b/Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/4A0FD71F-DAF4-4683-B49A-E196129C424E/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID deleted file mode 100644 index 30e4dd4..0000000 --- a/Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/4A0FD71F-DAF4-4683-B49A-E196129C424E/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID +++ /dev/null @@ -1,4 +0,0 @@ -{ - "materialPreviewEnvironmentType" : 2, - "materialPreviewObjectType" : 0 -} \ No newline at end of file diff --git a/Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/4D6F21B0-9DE3-4F39-9176-49F4BFCA0E77/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID b/Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/4D6F21B0-9DE3-4F39-9176-49F4BFCA0E77/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID deleted file mode 100644 index 30e4dd4..0000000 --- a/Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/4D6F21B0-9DE3-4F39-9176-49F4BFCA0E77/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID +++ /dev/null @@ -1,4 +0,0 @@ -{ - "materialPreviewEnvironmentType" : 2, - "materialPreviewObjectType" : 0 -} \ No newline at end of file diff --git a/Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/B136744D-6D64-4E4A-8C29-CCB04715F9CE/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID b/Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/B136744D-6D64-4E4A-8C29-CCB04715F9CE/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID deleted file mode 100644 index 30e4dd4..0000000 --- a/Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/B136744D-6D64-4E4A-8C29-CCB04715F9CE/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID +++ /dev/null @@ -1,4 +0,0 @@ -{ - "materialPreviewEnvironmentType" : 2, - "materialPreviewObjectType" : 0 -} \ No newline at end of file diff --git a/Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/E12B69A7-3D60-43A9-B84C-36943B66CF5D/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID b/Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/E12B69A7-3D60-43A9-B84C-36943B66CF5D/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID deleted file mode 100644 index 30e4dd4..0000000 --- a/Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/E12B69A7-3D60-43A9-B84C-36943B66CF5D/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID +++ /dev/null @@ -1,4 +0,0 @@ -{ - "materialPreviewEnvironmentType" : 2, - "materialPreviewObjectType" : 0 -} \ No newline at end of file diff --git a/Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/E2C6AE17-1719-4283-8EA0-553586E5C510/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID b/Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/E2C6AE17-1719-4283-8EA0-553586E5C510/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID deleted file mode 100644 index 30e4dd4..0000000 --- a/Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/E2C6AE17-1719-4283-8EA0-553586E5C510/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID +++ /dev/null @@ -1,4 +0,0 @@ -{ - "materialPreviewEnvironmentType" : 2, - "materialPreviewObjectType" : 0 -} \ No newline at end of file diff --git a/Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/E49BF78C-ACA0-4276-BC1C-33DFBFAD9F26/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID b/Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/E49BF78C-ACA0-4276-BC1C-33DFBFAD9F26/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID deleted file mode 100644 index 30e4dd4..0000000 --- a/Packages/ArtifactScenes/Package.realitycomposerpro/PluginData/E49BF78C-ACA0-4276-BC1C-33DFBFAD9F26/ShaderGraphEditorPluginID/ShaderGraphEditorPluginID +++ /dev/null @@ -1,4 +0,0 @@ -{ - "materialPreviewEnvironmentType" : 2, - "materialPreviewObjectType" : 0 -} \ No newline at end of file