Skip to content

Turn any video into a Mixamo-rig animation - GVHMR estimator, spec-driven retarget, FK apply in Blender via MCP. Works with any Mixamo character; built to be operated end-to-end by an AI agent.

Spec-level jump boost and windowed arm smoothing

Sacha07db4447ff6e
diff --git a/docs/PIPELINE.md b/docs/PIPELINE.md
index bdeab5a..36a9634 100644
--- a/docs/PIPELINE.md
+++ b/docs/PIPELINE.md
@@ -113,6 +113,21 @@ What each support does in the FK apply:
- `none`: no plant, no snapping; hip height integrates the estimator's
`pelvis_height` arc from the last planted frame (continuous takeoff,
ballistic flight). Landing pops are caught by QA's hip-step check.
+ Two tuning notes from real passes: (a) airborne detection fires only
+ once feet clear ~0.25 m, which EATS the launch rise if the window
+ starts there — start the `none` window at the true liftoff (watch
+ `pelvis_height` start climbing steeply); (b) the estimator tends to
+ understate jump amplitude — an optional `"boost": 1.3` on the window
+ scales the integrated arc (landing stays continuous because the arc's
+ endpoint is scaled too).
+
+An optional top-level `"smooth"` list applies extra windowed
+Savitzky-Golay smoothing to selected joints (default: both arm chains)
+where fast flurries read staccato:
+
+```jsonc
+"smooth": [ { "src": [172, 204], "window": 9 } ]
+```
## 4. Lift
diff --git a/pipeline/apply_mixamo_fk.py b/pipeline/apply_mixamo_fk.py
index edde8ce..bf97c8e 100644
--- a/pipeline/apply_mixamo_fk.py
+++ b/pipeline/apply_mixamo_fk.py
@@ -341,6 +341,17 @@ def run(spec_path: str) -> dict:
bpy.ops.object.mode_set(mode="POSE")
action = ensure_action(arm, spec["action_name"], end)
+ # Optional per-window amplitude boost for airborne arcs (the
+ # estimator tends to understate jump height; `"boost": 1.3` on a
+ # `none` plant window scales the integrated pelvis deltas).
+ boost_by_frame = {}
+ for wnd in spec.get("plant", []):
+ if wnd.get("support") == "none" and wnd.get("boost"):
+ a = int(round((wnd["src"][0] - 1) * dst_fps / src_fps + 1))
+ b = int(round((wnd["src"][1] - 1) * dst_fps / src_fps + 1))
+ for f_ in range(a, b + 1):
+ boost_by_frame[f_] = float(wnd["boost"])
+
prev_hip_y = 0.0
prev_ph = None
for fr in frames:
@@ -377,9 +388,10 @@ def run(spec_path: str) -> dict:
bpy.context.view_layer.update()
elif plant == "none":
# Airborne: no plant, no snapping. Hip height integrates the
- # estimator's real pelvis arc from the last applied height.
+ # estimator's real pelvis arc from the last applied height,
+ # optionally amplified by the window's "boost".
hips = arm.pose.bones["mixamorig:Hips"]
- hips.location = (loc_x, prev_hip_y + (ph - prev_ph) * 100.0, loc_z)
+ hips.location = (loc_x, prev_hip_y + (ph - prev_ph) * 100.0 * boost_by_frame.get(f, 1.0), loc_z)
bpy.context.view_layer.update()
elif plant in ("left", "right"):
foot = "mixamorig:LeftFoot" if plant == "left" else "mixamorig:RightFoot"
diff --git a/pipeline/lift_to_mixamo.py b/pipeline/lift_to_mixamo.py
index 1158ecd..5c96ed5 100644
--- a/pipeline/lift_to_mixamo.py
+++ b/pipeline/lift_to_mixamo.py
@@ -389,6 +389,29 @@ def main():
"plant": plant_at(sf) if rest_amt < 0.65 else "both",
"pelvis_height": float(pelvis_h[i])})
+ # Optional extra temporal smoothing on selected joints in selected
+ # windows (spec "smooth") — for fast flurries the raw estimator
+ # tracks can look staccato; a windowed Savitzky-Golay pass with
+ # smooth edge blending calms them without killing the snap.
+ for sm in spec.get("smooth", []):
+ a = max(1, int(round(src2dest(sm["src"][0]))))
+ b = min(n_dst, int(round(src2dest(sm["src"][1]))))
+ w = int(sm.get("window", 9))
+ w = min(w if w % 2 == 1 else w - 1, (b - a + 1) | 1)
+ if w < 5 or b - a < 4:
+ continue
+ keys = sm.get("joints", ["l_elbow", "l_wrist", "l_hand", "r_elbow", "r_wrist", "r_hand"])
+ ramp = max(2, w // 2)
+ for k in keys:
+ series = np.array([np.asarray(recs[f - 1][k], float) for f in range(a, b + 1)])
+ smoothed = np.stack(
+ [savgol_filter(series[:, c], window_length=w, polyorder=2, mode="interp")
+ for c in range(3)], axis=1)
+ for j, f in enumerate(range(a, b + 1)):
+ t = min(1.0, min(j, (b - a) - j) / float(ramp))
+ blend = smoother(t)
+ recs[f - 1][k] = series[j] * (1.0 - blend) + smoothed[j] * blend
+
# Support-ankle pinning (see module docstring).
RELEASE = 10
pos_keys = [k for k in recs[0] if not k.startswith("basis_")]