# DaVinci Resolve: the exact 38-frame outline page turn

This is a construction guide for `study-outline-page-turn` revision r02,
not the earlier generic quiet-ending treatment. The active mechanism is a heavy
closed leaf, successive hinge crossings, changing filled-page occlusion, an
open-book state, and a late rightward departure. Native Resolve execution and
SVG-import fidelity are **not verified**. The preparation commands and their
actual exported files are verified separately in `VERIFICATION.md`.

The paths are original art, not traces copied from source-film artwork. Keep
the attributed research clip in a separate reference bin; never use it as an
input layer or include it in a reusable asset pack.

## 1. Prepare the selected content

1. Read `CONTENT_CONTRACT.md`. Choose `default` (`rounded-book`) or `adaptation`
   (`field-notebook`). Both preserve the exact frame count and placement.
2. Set the existing external dependency directory, actual full Chrome executable,
   scratch root and shared encoder lock as in `README.md`. No install, dependency
   copy or dependency symlink is required. The full binary SHA is checked.
3. Set `OUTPUT_DIR` to a new **absolute off-volume destination outside the repo
   and kit**. Include its existing parent in the storage accounting roots.
4. Execute these real preparation commands from the kit directory:

   ```bash
   bash scripts/run.sh prepare --variant default --out "$OUTPUT_DIR/default/prepare"
   bash scripts/run.sh prepare --variant adaptation --out "$OUTPUT_DIR/adaptation/prepare"
   ```

5. For each variant, expect 38 `svg/poses/pose-NNN.svg`, 111
   `svg/leaves/pose-NNN-order-K.svg`, 38 `png/complete/frame-NNN.png`, and four
   `png/order-K/` sequences of 38 PNGs each. Numbering is **000–037**.
   All rasters are 1920×1080. Absent orders are fully transparent frames, not
   missing files; do not remove those images or the sequences will shift.
6. Keep `preparation.manifest.json` with the external output. The source-only
   copies of its SVGs and control tables are already in `assets/VARIANT/`.
   Each of 38 rows in `frame-controls.csv` names position, stroke and frame
   selection; each of 111 rows in `path-controls.csv` names the exact path data,
   fill and back-to-front order. `controls.json` contains the same structured data.

The preparation rasterizer paints those original SVG paths with the pinned full
Chrome. It does **not** decode a reference movie. It has a small, measured
antialiasing difference from the shared Remotion HTML/SVG render path; do not
describe the prepared plates or a Resolve render as pixel-identical to Remotion.

## 2. Establish the timeline before importing

1. Create a 1920×1080 progressive timeline, **30 fps**, square pixels. Set the
   playback rate to 30 as well; do not select 29.97 or infer fps from a PNG.
2. Set its starting timecode to `00:00:00:00`. The active interval is 38 frames:
   first frame `00:00:00:00`, last included frame `00:00:01:07`, exclusive end
   `00:00:01:08`. Source frame 115 corresponds to timeline/local frame 0.
3. Keep sizing at native resolution. Disable optical flow, speed changes,
   transitions, motion blur, stabilization and automatic reframing. There is no
   audio track for this treatment.
4. For pixel checking, use an unmanaged DaVinci YRGB setup with no LUT/CST or
   grade, full-range PNG data and no viewer LUT. Record the actual color settings.
   Color-management and gamma parity are a workstation check, not established
   by these instructions; white should remain white and ink should not lift.

## 3. Build the actual ordered-leaf composition

This route retains separate page surfaces in Resolve, with their changing shape
and position supplied at every frame. It is not a rigid icon rotation.

1. In Media Storage, disable **Show Individual Frames** so each numbered folder
   imports as one image sequence. Import `png/order-0` through `png/order-3` from
   one variant. In Clip Attributes, verify 30 fps and 38 frames for each. If the
   importer shows 38 still clips, correct sequence grouping before continuing.
2. Create a 38-frame Fusion Composition. Ensure Fusion's composition range is
   **0–37**; if the host uses an offset, explicitly subtract that offset in every
   time expression in the vector route below. Do not confuse source-frame 115
   with the Fusion composition's local start.
3. Drag the four sequence clips from the Media Pool into Fusion's node graph.
   Name the MediaIn nodes `Order0`, `Order1`, `Order2`, `Order3`. All four must
   start at local 0 and expose source image 000 at that frame. Loop and hold
   extensions must not substitute for the supplied 38 frames.
4. Create a full-frame opaque-white Background, named `Paper`. Set alpha to 1.
   Build this chain, using each Merge's **yellow background** and **green
   foreground** inputs:

   ```text
   Paper -> Merge0(bg) -> Merge1(bg) -> Merge2(bg) -> Merge3(bg) -> MediaOut
               ^              ^             ^             ^
          Order0(fg)      Order1(fg)     Order2(fg)     Order3(fg)
   ```

5. Use Normal/Over compositing with Blend 1. Interpret the transparent PNGs as
   straight alpha. Verify this in the host: a black halo means the alpha or
   premultiplication interpretation needs correction, not another ink stroke.
6. Do **not** apply the CSV x/y translation to these full-frame plates. Their
   1920×1080 canvas already contains the exact position. Leave Merge Center at
   0.5/0.5, Size 1, Angle 0. A second transform doubles the motion.
7. Inspect frame 0: order 0 is an ink-filled backing shape; order 1 has an opaque
   white interior. Orders 2 and 3 are empty. At frame 6 all visible surfaces have
   white interiors; they must cover strokes behind them, not become wireframes.
8. Inspect frame 11: order 2 becomes nonempty. At frame 15 order 3 becomes
   nonempty. At frame 23 order 3 becomes empty again. Keep four stable sequence
   inputs; their transparent frames implement these topology changes.
9. Import `png/complete` separately as an opaque reference sequence. Compare it
   to `Merge3` using a temporary Difference merge or viewer wipe. Keep it out of
   the final node chain. Independent 8-bit alpha recomposition has a measured
   maximum 2/255 channel difference from the complete SVG raster in the supplied
   preparation; do not hide a larger host discrepancy behind that observation.

## 4. Native editable SVG route — workstation verification required

Use this route when the Resolve operator needs native editable shapes rather
than individually replaceable leaf plates. It is explicit but laborious: the
retained treatment owns 38 distinct poses, not a single morphable polygon.

1. Use Fusion's **Import > SVG** command (the containing Resolve/Fusion menu
   varies by version) to import `assets/VARIANT/svg/poses/pose-000.svg`.
   Inspect the imported node group. It must retain the full 1920×1080 viewport,
   the nested 320×320 leaf viewports and the white field. Name it `Pose000`.
2. Check the initial group top-left at **(947,463)**, not centered on the frame.
   Both leaf paths have a 20 px stroke; the first fills ink, the second fills
   white. Inspect imported fills and strokes separately. Miter joins, butt caps,
   nonzero fill and opaque white interiors are part of this exact recipe.
3. Import `pose-001.svg` through `pose-037.svg` as separate groups, named by local
   frame. No curve interpolation is needed between groups. At frame n, select
   only `PoseNNN`; do not morph the endpoints of two differently ordered poses.
4. Start with a white Background. Merge every pose into a chain over that
   background. Set each pose's Merge Blend to its `frame-controls.csv`
   expression, for example **`iif(time == 15, 1, 0)`** for `Pose015` when the
   composition range starts at 0. A pose's entire group is active for one frame.
   At any local 0–37 exactly one pose merge must have Blend 1, all others 0.
5. If you want separate native leaf groups, import the per-leaf SVG files for
   that pose instead. Merge them in ascending order K: 0 first/backmost, highest
   order last/frontmost. Group the result as `PoseNNN` before the one-frame
   selection. There are 111 leaf groups over the 38 poses, not four persistent
   physical pages with stable point correspondence.
6. The raw SVG `d` string is in `path-controls.csv` and `controls.json`. These
   are SVG commands, **not directly pasteable Fusion Polygon keyframes**.
   Let the SVG importer convert them. In local SVG coordinates, an anchor or
   control point `(u,v)` lands at canvas `(x+u,y+v)` using that frame's x/y row.
   If inspecting a local 320×320 group in normalized image coordinates, its
   center is `((x+160)/1920, 1-(y+160)/1080)`; do not apply this a second time
   to a full-frame imported SVG.
7. If the importer drops a nested viewport, changes stroke width or changes
   occlusion, stop this route. The current kit does not certify the importer or
   provide a tested native `.setting`/`.drp`. Use the verified preparation route
   above, or record and fix the import conversion before claiming parity.

## 5. All-frame position and occlusion controls

These are **retained reconstruction controls**, not official OpenAI parameters.
Use `assets/VARIANT/path-controls.csv` for the exact 111 path strings. All groups
have a 320×320 local viewport; all stroke widths after frame 5 are 17 px.

| Local | Source | X px | Y px | Visible leaves | Stroke px |
| --- | --- | --- | --- | --- | --- |
| 0 | 115 | 947 | 463 | 2 | 20 |
| 1 | 116 | 948 | 467 | 2 | 19.4 |
| 2 | 117 | 949 | 467 | 2 | 18.8 |
| 3 | 118 | 949 | 466 | 2 | 18.2 |
| 4 | 119 | 949 | 465 | 2 | 17.6 |
| 5 | 120 | 949 | 462 | 2 | 17 |
| 6 | 121 | 949 | 457 | 2 | 17 |
| 7 | 122 | 949 | 448 | 2 | 17 |
| 8 | 123 | 949 | 438 | 2 | 17 |
| 9 | 124 | 949 | 429 | 2 | 17 |
| 10 | 125 | 949 | 423 | 2 | 17 |
| 11 | 126 | 924 | 425 | 3 | 17 |
| 12 | 127 | 905 | 429 | 3 | 17 |
| 13 | 128 | 893 | 432 | 3 | 17 |
| 14 | 129 | 883 | 428 | 3 | 17 |
| 15 | 130 | 875 | 422 | 4 | 17 |
| 16 | 131 | 870 | 426 | 4 | 17 |
| 17 | 132 | 866 | 423 | 4 | 17 |
| 18 | 133 | 862 | 423 | 4 | 17 |
| 19 | 134 | 862 | 424 | 4 | 17 |
| 20 | 135 | 862 | 426 | 4 | 17 |
| 21 | 136 | 862 | 427 | 4 | 17 |
| 22 | 137 | 862 | 428 | 4 | 17 |
| 23 | 138 | 862 | 429 | 3 | 17 |
| 24 | 139 | 862 | 429 | 3 | 17 |
| 25 | 140 | 862 | 429 | 3 | 17 |
| 26 | 141 | 862 | 429 | 3 | 17 |
| 27 | 142 | 862 | 430 | 3 | 17 |
| 28 | 143 | 862 | 430 | 3 | 17 |
| 29 | 144 | 862 | 430 | 3 | 17 |
| 30 | 145 | 862 | 430 | 3 | 17 |
| 31 | 146 | 862 | 430 | 3 | 17 |
| 32 | 147 | 863 | 430 | 3 | 17 |
| 33 | 148 | 865 | 430 | 3 | 17 |
| 34 | 149 | 868 | 430 | 3 | 17 |
| 35 | 150 | 873 | 430 | 3 | 17 |
| 36 | 151 | 881 | 430 | 3 | 17 |
| 37 | 152 | 902 | 430 | 3 | 17 |

## 6. Path changes without invented choreography

The source-specific curve generator in `adapters/typography.ts` owns the closed
bow, hinge positions, page-edge curves and page ordering. For a permitted content
change, write a new bounded design JSON and regenerate the SVGs/plates using
`--design inputs/NAME.json`. The bounded factory creates all 111 slots; do not
replace them with one rigid page rotated across a pivot.

The leaf construction from local 6 uses a vertical hinge tangent and cubic
returning curves. In r02, only negative-reach turning leaves of `rounded-book`
replace their lower quadratic corner with a cubic. Its endpoints are unchanged;
the entry handle stays vertical, and the exit handle aligns with the following
unchanged return curve. Do not replace this cubic with a horizontal corner
handle or change global miter joins: that would restore the tested tangent
break or alter unrelated geometry. `field-notebook` remains unchanged.

For a native imported default pose, locate the changed leaf by local frame and
back-to-front order: frames11–15 order0;16–17 order2;18–22 orders2/3;23–37 order2.
For example, `pose-026-order-2.svg` has the repaired corner. Verify its imported
anchors/handles against that file and `path-controls.csv`; the following cubic,
17px stroke, white fill and merge order must not move. This changes one command
in each of32 path slots, not the point correspondence of every pose. Do not
interpolate across the Q/C topology. Full native-import verification remains
unperformed; use the prepared sequence if the importer cannot preserve it.

## 7. Verification and export on the workstation

1. Step all **38** local frames, not just endpoints. Check 5→6, 10→11, 14→15,
   15→16, 17→18 and 22→23 for changed contours and opaque occlusion. Check
   25→26 and30→31 around the repair focus, then31→37 for the late translation.
   Inspect the full canvas as well as ROI [890,550,100,100]. No empty frame may
   appear before the cut. A small ROI residual is not a whole-clip fidelity pass.
2. Export a lossless RGB/PNG sequence to an external directory, no audio,
   exactly 38 frames. Compare all frames to the prepared complete sequence;
   retain actual export hashes, color settings and the Resolve/Fusion version.
3. Only after that check, export the review MP4 at 1920×1080, 30 fps progressive,
   H.264/yuv420p, Rec.709 tags, no audio. Do not expect a different encoder to
   produce the same compressed bytes as Remotion. Check decoded frames/count,
   timing and color, not the MP4 hash alone.
4. Separately review at normal moving playback against the attributed source.
   The source clip's CFR clock is a derivative; `source-clock.json` retains the
   native millisecond PTS distinction. Record real-time judgment separately
   from static inspection and mechanical checks.
5. Save the native project and source-only SVG/design inputs with the export.
   Do not mark native Resolve verified until an actual native render passes.
   Do not mark source fidelity complete while either retained finding is open.
