メインコンテンツへスキップ
P

dsh-pptx-animation

player462/dsh-pptx-animation

Native PowerPoint animation studio: compile a declarative DSL into editable p:timing OOXML, with physical motion curves carrying real inertial overshoot (seven shapes, including acceleration from rest), cross-slide Morph transitions, p:sld element-order validation, and a verify mode that checks transitions in a real PowerPoint.

インストール

dsh plugin --profile web add github:player462/dsh-pptx-animation

README

PPTX native animation studio

Author native PowerPoint animations from a declarative DSL — not video, not presets. Compiles straight into editable <p:timing> OOXML that you can keep editing in PowerPoint.

Tools

  • pptx_anim_inspect — list every shape's id / name / text per slide, to pick animation targets.
  • pptx_anim_compile — compile the animation DSL into native animations, written to a new pptx (source untouched).
  • pptx_anim_read — read the animations already present in a pptx, for iteration.
  • pptx_anim_verify — open in real PowerPoint and check each slide's transition and animation count, catching silent failures.

DSL

{
  "defaults": { "durationMs": 500, "direction": "bottom" },
  "slides": {
    "1": {
      "transition": "morph",
      "animations": [
        { "target": "title", "effect": "zoom", "trigger": "afterPrev",
          "durationMs": 1000, "overshoot": 0.9, "curve": "back" }
      ]
    }
  }
}
  • target: shape id (int), name (string), or {"text": "..."}. Name matching prefers exact; an ambiguous fuzzy match raises AmbiguousTarget instead of silently taking the first hit.
  • effect: appear / fade / flyIn / wipe / splitIn / bounce / flipIn / zoom / pulse / spin / grow / teeter / disappear / fadeOut / flyOut / wipeOut / shrink / zoomOut / motionPath.
  • trigger: onClick / withPrev / afterPrev.
  • Timing: durationMs, delayMs, accelerate, decelerate (0–100).
  • Other: direction, repeatCount, repeatDelayMs, degrees, motionPath, paragraph, triggerShape.
  • transition: either a string ("morph") or an object. Effects: fade / wheel(spokes) / morph(option) / wipe / push and more; plus speed, durationMs, advanceAfterMs.

Physical motion curves (overshoot)

accelerate / decelerate produce monotonic curves only: speed varies, displacement never goes backwards. Real objects overshoot and settle back. overshoot emits custom keyframes:

curveStartOvershootFeel
back (default)fast (34% in first 10%)yes (+3%)fast start → decelerate → settle
inBackback-swing (−0.1%)noanticipate, then accelerate out
inOutBackback-swing (−1.8%)yes (+3.4%)overshoot at both ends, elastic
inCubic~zero (0.1%)nopure acceleration, free fall
quintfastest (41%)nohard deceleration, crisp
cubicslow (0.4%)noslow-fast-slow
bounceslow (7.6%)no (bounces)landing bounce

The distinction that matters: back is fastest from the first frame; inCubic / inBack accelerate from rest. Use the former for "being pushed", the latter for "starting itself".

Tuning knobs:

  • overshoot — intensity; 0 disables overshoot (degrades to hard deceleration), 0.9 is moderate, 1.5+ is exaggerated. Applies to back / inBack / inOutBack.
  • curveSamples — keyframe count, default 18, range 4–120. Raise it for complex curves (bounce, inOutBack) or long durations, or the piecewise-linear result looks steppy.
  • curveEasing — extra time remap t' = t^easing on top of any curve; <1 faster overall, >1 slower.
  • overshootDistance — entry travel distance, default 0.18 (fraction of shape size).
  • overshootScaleFrom — starting scale for zoom, default 0.86.

Supported on flyIn / fade / zoom / appear; other effects print a WARN and ignore it.

Validation

compile performs two checks:

  1. OOXML element order — p:sld children must be cSld → clrMapOvr → transition → timing. Out of order, PowerPoint silently ignores the transition and Morph never runs.
  2. Problem summary — missing targets, unknown effects, unreliable charRange, byWord morph fallback; all collected into a PROBLEMS: block on stderr. Quiet mode returns OK_WITH_PROBLEMS instead of OK when anything would not play.

pptx_anim_verify opens the file in real PowerPoint via pywin32:

{"1": {"transition": "morph", "animations": 3}}

Mismatches are reported per slide and the call exits with code 2.

Important: EntryEffect reflects structure only. All of these still report 3954 (Morph) while looking completely different on screen:

  • transition element in the wrong place → node ignored, hard cut
  • element reset by an entrance animation → plain fade

Visual cross-slide morphing must be confirmed by capturing slideshow frames. See PITFALLS.md.

Known limits

  • charRange needs character-level bldP; only build="p" is emitted, so PowerPoint usually will not play it. Use paragraph instead.
  • morph option="byWord"/"byChar" silently degrades to a fade on most versions; compile warns.
  • p14:dur is honoured by some versions only; spd is the portable knob, both are written.
  • Morph itself needs PowerPoint 2019 / Microsoft 365; WPS degrades it to a fade.

Requirements

Python 3 with python-pptx (py -3 -m pip install python-pptx). verify additionally needs pywin32 and a local PowerPoint install. The compiler ships with the plugin.

Pitfalls

PITFALLS.md documents 9 real OOXML silent-failure cases, each with why it went unnoticed.

関連プラグイン