Surface machine settings in the exercise library and refine machine rigs
Library detail screens now lead with the user's recorded machine settings (per-split when they disagree, empty-state card for machine-based entries) and append the weight progression chart. Starter seeds mark machine exercises with an empty machineSettings list so the settings UI lights up before first use. The figure rig gains a frontal body profile for face-on machines, props that can ride mid joints (knees/elbows), and an alternating four-frame Bird Dog loop. Claude-Session: https://claude.ai/code/session_01LEoff8bXGBS83tK1c55Mf7
This commit is contained in:
@@ -35,6 +35,9 @@ struct ExerciseMotion: Codable {
|
||||
let name: String
|
||||
/// 1-based frame used for the static visual (unused by the animated renderer).
|
||||
let primary: Int?
|
||||
/// Body-profile override (e.g. `"frontal"`: foreshortened legs for face-on
|
||||
/// seated machines). Nil uses the `neutral` profile.
|
||||
let figure: String?
|
||||
/// Parts (`arm_r`, `leg_l`, `spine`, …) drawn in the working accent color.
|
||||
let working: [String]?
|
||||
/// Limbs fully occluded in this view — never drawn.
|
||||
@@ -45,8 +48,9 @@ struct ExerciseMotion: Codable {
|
||||
let frames: [MotionKeyFrame]
|
||||
}
|
||||
|
||||
/// A prop's joint reference: one extremity (`"hand_r"`) or the midpoint of two
|
||||
/// (`["foot_r", "foot_l"]`). Extremity keys match the pin keys.
|
||||
/// A prop's joint reference: one joint (`"hand_r"`, `"knee_l"`, `"elbow_r"`, …)
|
||||
/// or the midpoint of two (`["foot_r", "foot_l"]`, `["knee_r", "foot_r"]`).
|
||||
/// Extremity keys match the pin keys; elbows/knees are the mid joints.
|
||||
enum PropJointRef: Codable {
|
||||
case single(String)
|
||||
case midpoint([String])
|
||||
@@ -180,7 +184,7 @@ enum ExerciseMotionLibrary {
|
||||
let bodyData = try? Data(contentsOf: bodyURL),
|
||||
let motion = try? JSONDecoder().decode(ExerciseMotion.self, from: motionData),
|
||||
let profiles = try? JSONDecoder().decode([String: ExerciseBodyProfile].self, from: bodyData),
|
||||
let body = profiles["neutral"]
|
||||
let body = profiles[motion.figure ?? "neutral"]
|
||||
else { return nil }
|
||||
return Resources(motion: motion, body: body)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user