Replace the YAML exercise catalogs with the motion-rig exercise library
The exercise picker now lists the bundled exercise library — the motion-rig exercises exported from Exercise Library/ — instead of the two *.exercises.yaml starter catalogs. ExerciseListLoader and the Yams dependency are removed; ExerciseMotionLibrary gains exerciseNames, the bundle enumeration the picker reads.
This commit is contained in:
@@ -83,6 +83,19 @@ enum ExerciseMotionLibrary {
|
||||
let body: ExerciseBodyProfile
|
||||
}
|
||||
|
||||
/// Every exercise with a bundled motion script, sorted alphabetically. XcodeGen
|
||||
/// flattens resource groups, so `<Exercise Name>.motion.json` files land in the
|
||||
/// bundle root alongside `body.json` — enumerate all json and filter on the
|
||||
/// compound suffix (which `body.json` doesn't match).
|
||||
static let exerciseNames: [String] = {
|
||||
let urls = Bundle.main.urls(forResourcesWithExtension: "json", subdirectory: nil) ?? []
|
||||
return urls
|
||||
.map(\.lastPathComponent)
|
||||
.filter { $0.hasSuffix(".motion.json") }
|
||||
.map { String($0.dropLast(".motion.json".count)) }
|
||||
.sorted()
|
||||
}()
|
||||
|
||||
/// The motion script plus the neutral body profile for `exerciseName`, or `nil`
|
||||
/// when no bundled motion matches (most exercises have none — the caller keeps
|
||||
/// its space empty).
|
||||
|
||||
Reference in New Issue
Block a user