diff --git a/CHANGELOG.md b/CHANGELOG.md index a1a99ab..f7828d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,18 @@ # Changelog +## v0.12.8 - 2026-04-28 +### 🐞 Fixes +- [Patch] Updated script to follow engine dependency tag version (761dc47…) +- [Patch] make app bundle script copy 'usdz-untold' script (0df0207…) +- [Patch] added support to export tile scenes (943c3e8…) +- [Patch] Added support for astc and lz4 optimization. (8a403a3…) +- [Patch] Added post fx preset to Effects View (7beb4ff…) +## v0.12.8 - 2026-04-28 +### 🐞 Fixes +- [Patch] Updated script to follow engine dependency tag version (761dc47…) +- [Patch] make app bundle script copy 'usdz-untold' script (0df0207…) +- [Patch] added support to export tile scenes (943c3e8…) +- [Patch] Added support for astc and lz4 optimization. (8a403a3…) +- [Patch] Added post fx preset to Effects View (7beb4ff…) ## v0.12.7 - 2026-04-25 ### 🐞 Fixes - [Patch] AssetBrowserView now accepts untold files (f972fa2…) diff --git a/Package.swift b/Package.swift index 50a04fd..1f6bec0 100644 --- a/Package.swift +++ b/Package.swift @@ -13,7 +13,7 @@ let package = Package( // Use a branch during active development: // .package(url: "https://github.com/untoldengine/UntoldEngine.git", branch: "develop"), // Or pin to a release: - .package(url: "https://github.com/untoldengine/UntoldEngine.git", exact: "0.12.7"), + .package(url: "https://github.com/untoldengine/UntoldEngine.git", exact: "0.12.8"), ], targets: [ .executableTarget( diff --git a/Sources/UntoldEditor/Editor/AssetBrowserView.swift b/Sources/UntoldEditor/Editor/AssetBrowserView.swift index 96f284a..3ccd431 100644 --- a/Sources/UntoldEditor/Editor/AssetBrowserView.swift +++ b/Sources/UntoldEditor/Editor/AssetBrowserView.swift @@ -23,6 +23,13 @@ struct RuntimeExportRequest: Identifiable, Equatable { let outputURL: URL } +struct TilesExportRequest: Identifiable, Equatable { + let id = UUID() + let sourceURL: URL + let destinationFolder: URL + let outputDirURL: URL +} + func copyRuntimeAssetSidecars(for sourceURL: URL, to destinationFolder: URL, fileManager fm: FileManager = .default) throws { let sourceFolder = sourceURL.deletingLastPathComponent() @@ -170,16 +177,104 @@ func importStreamModelManifest(sourceURL: URL, destinationFolder: URL, fileManag } } -func findExportUntoldScript(fileManager fm: FileManager = .default) -> URL? { +func findUntoldEngineScript(named name: String, fileManager fm: FileManager = .default) -> URL? { let cwd = URL(fileURLWithPath: fm.currentDirectoryPath, isDirectory: true) - let candidates = [ - cwd.appendingPathComponent("../UntoldEngine/scripts/export-untold").standardizedFileURL, - cwd.appendingPathComponent("scripts/export-untold").standardizedFileURL, - URL(fileURLWithPath: NSHomeDirectory(), isDirectory: true) - .appendingPathComponent("Desktop/UntoldEngineStudio/UntoldEngine/scripts/export-untold"), + + var scriptsDirCandidates: [URL] = [] + + // DMG / installed app: scripts are bundled in Contents/Resources/scripts/ + if let resourceURL = Bundle.main.resourceURL { + scriptsDirCandidates.append(resourceURL.appendingPathComponent("scripts").standardizedFileURL) + } + + scriptsDirCandidates += [ + // `swift run` from the package root: cwd is the package root + cwd.appendingPathComponent(".build/checkouts/UntoldEngine/scripts").standardizedFileURL, + // Local package override (Package.swift uses path: "../UntoldEngine") + cwd.appendingPathComponent("../UntoldEngine/scripts").standardizedFileURL, ] - return candidates.first { fm.isExecutableFile(atPath: $0.path) || fm.fileExists(atPath: $0.path) } + if let execURL = Bundle.main.executableURL { + // SPM CLI build: executable is at .build/// + // Three levels up lands at .build/ + let spmBuildDir = execURL + .deletingLastPathComponent() // / + .deletingLastPathComponent() // / + .deletingLastPathComponent() // .build/ + scriptsDirCandidates.append( + spmBuildDir.appendingPathComponent("checkouts/UntoldEngine/scripts").standardizedFileURL + ) + + // Xcode build: executable is at DerivedData//Build/Products// + // Four levels up lands at DerivedData// + let derivedDataDir = execURL + .deletingLastPathComponent() // / + .deletingLastPathComponent() // Products/ + .deletingLastPathComponent() // Build/ + .deletingLastPathComponent() // DerivedData// + scriptsDirCandidates.append( + derivedDataDir.appendingPathComponent("SourcePackages/checkouts/UntoldEngine/scripts").standardizedFileURL + ) + } + + return scriptsDirCandidates + .map { $0.appendingPathComponent(name) } + .first { fm.isExecutableFile(atPath: $0.path) || fm.fileExists(atPath: $0.path) } +} + +func findExportUntoldScript(fileManager fm: FileManager = .default) -> URL? { + findUntoldEngineScript(named: "export-untold", fileManager: fm) +} + +func findExportUntoldTilesScript(fileManager fm: FileManager = .default) -> URL? { + findUntoldEngineScript(named: "export-untold-tiles", fileManager: fm) +} + +func findTexbakeScript(fileManager fm: FileManager = .default) -> URL? { + findUntoldEngineScript(named: "texbake.py", fileManager: fm) +} + +/// Runs `python3