"""Dog walk (a viewer's request on stream, 2026-10-10/11): a trot on all fours on a human skeleton. Bear-crawl posture: pelvis high, torso sloping down to the shoulders, arms straight down as front legs, head up. Diagonal pairs move together (left front with right hind), like a trotting dog. Bento tail bones wag (only shows with a tail mesh). 1.0 s loop, priority 5. Claude Opus 5.5.""" import json, math from pathlib import Path N = 8; DUR = 1.0 DROP = -0.22 # pelvis drop TORSO = 122 # torso pitch forward (deg); past horizontal so the shoulders sit low; chest adds more keys = [] for i in range(N + 1): t = round(DUR * i / N, 4); ph = 2 * math.pi * i / N def front(p, side): # arm as a front leg: swings fore/aft, lifts (bends) on the forward swing s = math.sin(p); lift = max(0.0, math.cos(p)) sh = [0.28 * s, 0.06 * side, -1] el = [0.28 * s + 0.35 * lift, 0.04 * side, -1] wr = [1, 0.1 * side, -0.6 - 0.3 * lift] return sh, el, wr def hind(p): # bent hind leg: thigh forward-down, shin back-down, knee folds more on the swing s = math.sin(p); lift = max(0.0, math.cos(p)) hip = [1.0 + 0.3 * s, 0, -1] knee = [-1.5 + 0.3 * s - 0.4 * lift, 0, -1] ank = [1, 0, -0.35] return hip, knee, ank sl, el, wl = front(ph, 1); sr, er, wr = front(ph + math.pi, -1) hr, kr, ar = hind(ph); hl, kl, al = hind(ph + math.pi) # right hind with left front bob = 0.025 * abs(math.cos(ph)) wag = 25 * math.sin(2 * ph) keys.append({"t": t, "pos": {"mPelvis": [0, 0, DROP + bob]}, "rot": {"mTorso": [0, TORSO, 3 * math.sin(ph)], "mChest": [0, 10, 0], "mNeck": [0, -75, 0], "mHead": [0, -70, 4 * math.sin(ph)], "mTail1": [0, -30, wag], "mTail2": [0, 0, wag], "mTail3": [0, 0, wag]}, "aim": {"mShoulderLeft": sl, "mElbowLeft": el, "mWristLeft": wl, "mShoulderRight": sr, "mElbowRight": er, "mWristRight": wr, "mHipLeft": hl, "mKneeLeft": kl, "mAnkleLeft": al, "mHipRight": hr, "mKneeRight": kr, "mAnkleRight": ar}}) spec = {"name": "dog walk", "duration": DUR, "priority": 5, "loop": True, "loop_in": 0.0, "loop_out": DUR, "ease_in": 0.3, "ease_out": 0.3, "hand_pose": "relaxed", "keys": keys} Path(__file__).with_name("dogwalk.json").write_text("// generated by gen_dogwalk.py\n" + json.dumps(spec, indent=1)) print("ok")