Communitygithub.com

animating-pptx-decks

Use when the user asks for a PowerPoint or .pptx deck with animation or motion — «انميشن», «خلي أشياء تتحرك», «حركات في العرض», «عرض متحرّك», a process, mechanism, particles or flow shown moving on slides — asks to put animated scenes, simulations or videos inside slides («ضعها في الشرائح», «حط الفيديو في العرض»), wants animation added to an existing deck, or when a video on a slide does not start by itself, an animated deck became too big to send, or PowerPoint's own effects cannot show the motion.

What is animating-pptx-decks?

animating-pptx-decks is a Claude Code agent skill that use when the user asks for a PowerPoint or .pptx deck with animation or motion — «انميشن», «خلي أشياء تتحرك», «حركات في العرض», «عرض متحرّك», a process, mechanism, particles or flow shown moving on slides — asks to put animated scenes, simulations or videos inside slides («ضعها في الشرائح», «حط الفيديو في العرض»), wants animation added to an existing deck, or when a video on a slide does not start by itself, an animated deck became too big to send, or PowerPoint's own effects cannot show the motion.

Works with~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/Sniper797/Animated-PPTX-Skill/tree/HEAD

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentation

Animating pptx decks

Overview

A deck gets motion from two sources, both written by PowerPoint itself through COM: PowerPoint's own animation (effects, motion paths, Morph) and video clips embedded on slides. Use PowerPoint's own animation when it can show the motion; render a clip when it cannot. Either way the proof is PowerPoint's own export of the show, never a script's success message.

Core principle: animation is there so the audience sees the subject happen. Before building, ask "what should be seen happening?" and say in one line which reading you take. Bullets that fly in are not it: a build of 243 entrance effects was answered with «لا ما اقصد هذي الحركات».

Needs Windows with PowerPoint and pywin32 (effects, embedding, checks), and Node 22+, Edge or Chrome, ffmpeg (recording). python example/smoke_test.py <empty folder> proves the whole chain on a throwaway deck in about 20 seconds (18 checks). Run it before the first job of a session and after changing a script; it is too cheap to skip. No PowerPoint on the machine (Mac, Linux, cloud): only the recording can run there (not tried); say so instead of switching to python-pptx, which cannot write animation.

Building the scenes page itself, or a whole presentation as a 3D HTML page (the drawing, the captions, the science in it), is another skill's work: building-3d-html-presentations, when it is installed. This one is for motion inside a .pptx, and starts from "a page that can draw any moment on demand" or from PowerPoint's own tools.

Native or video: decide per motion

What must be seenRoute
Parts of a slide arriving as the speaker reaches themeffects: native_effects.py, slides
One thing changing place, size, angle or colour; moving in on one part of a pictureMorph: native_effects.py, morph
Up to about 6 shapes following a path, pulsing, repeatingeffects: path, pulse
A chart growing series by seriestiming XML (below)
Many bodies at once (particles, molecules, traffic), 3D or a moving camera, motion computed from a formula or a simulation, a curve drawn in step with the scenevideo

If the frame has to be computed, it is a video. Do not imitate a simulation with dozens of motion paths.

PowerPoint's own animation

python scripts/native_effects.py deck.pptx --list prints every shape (number, name, place, text) and flags a name used twice (pptxgenjs repeats "Text 0"). Write a plan, then native_effects.py in.pptx out.pptx plan.json. The plan format is in the script's header.

  • "start": "click" where the speaker chooses the moment (a point they talk to), "after" where it should simply happen; a first step with "after" plays when the slide opens. Every click is one more thing a presenter must remember: report the clicks per slide, and put them in the slide's notes with the plan's "notes".
  • COM effect numbers above about 25 are not the XML presetID (float-up is 39 in COM, 42 in the file). Use the script's table; check any new number by reading presetClass and presetID in the saved slide XML.
  • A list "by paragraph" arrives as one effect per line, all on click. The script chains them so the list costs one click; "one_click_each": true keeps one click per line, for points the speaker talks through.
  • A path is relative to the shape's own place, and --list prints top-left corners. Give the goal instead of the arithmetic: "to_shape": "Beaker" or "to": [x, y] lands the shape's centre there.
  • A motion path built from the custom effect (COM 0 plus an added motion behaviour) is saved as an entrance: the shape stays hidden until its path starts. The script starts from a ready-made path (127) and replaces its path text.
  • Morph (3954) needs the shape on both slides: the script copies the slide, changes the copy, and strips the effects the copy inherited, which it would otherwise replay.
  • Chart builds fail through COM ("Invalid request"). Write them into the timing XML: inside each <p:spTgt> put <p:graphicEl><a:chart seriesIdx="k" categoryIdx="-3" bldStep="series"/></p:graphicEl>, give new cTn ids, set <p:bldGraphic><p:bldSub><a:bldChart bld="series"/></p:bldSub></p:bldGraphic>, then prove PowerPoint reopens the file with the extra effects.

Video clips

  1. A page that can be recorded. example/demo-scene.html is the smallest one: a ready flag, seekScene(t) that draws that moment before it returns, one 16:9 stage element, a mode with no controls and no clock of its own, and every position a function of t (seeded numbers, never Math.random() or Date.now(); a random walk is computed once and then read at t). Captions are drawn inside the stage, in the deck's language only, and the scene stays clear of the caption band. Clips that worked ran 14 to 20 s each.
  2. Record. node scripts/record_scenes.js config.json steps the page frame by frame through the DevTools port and pipes the pictures to ffmpeg: H.264, yuv420p, 1920×1080, 30 frames per second, no sound, plus clips.json. It captures 12 to 17 frames a second, so a 20 s clip takes about 40 s.
  3. Embed. python scripts/embed_videos.py in.pptx out.pptx plan.json. "after": N makes a new slide right after the slide the clip explains, filled by the clip, starting by itself, one click to go on. "on": N puts the clip in a box on an existing slide (find the free space with --list); with "start": "open" that slide's own "after" steps wait until the clip has ended. A clip in a box never matches the slide's colour exactly (white came back as 253,255,255): frame or tint the stage instead of counting on an invisible edge.
Seen failureDo this
A screenshot of the playing page stays at time 0Headless --virtual-time-budget never runs requestAnimationFrame. Seek, then screenshot, frame by frame
ffprobe says yuvj420pBrowser pictures are full range; convert to TV range (the recorder's scale filter does)
The clip does not start with the slideIt needs a media-play effect (83), "after previous", as the slide's first effect; the saved XML then holds cmd="playFrom(0.0)"
The picture jumps when playback startsThe slide shows the poster first. Leave the poster at frame 0 and make frame 0 a finished picture
Clips land on the wrong slidesPlan numbers are the deck's numbers before the run; the script inserts from the end backwards. Slide-number fields update themselves
A COM script fails halfway, or the user's open deck closesOne COM script at a time; quit PowerPoint only if nothing was open in it before (the scripts check)
The deck is too big to sendEach clip adds its bytes plus about 1 MB of poster: 10 clips (158 s) took a deck from 0.8 to 60.7 MiB. Say the size before embedding; above 25–30 MiB e-mail and Remote Control refuse it
The talk runs overClips add their full length: 158 s was a quarter of a 12-minute talk. Report the total and let the user choose which slides to hide

Verify before showing anyone

python scripts/verify_deck.py deck.pptx --pics dir --pdf deck.pdf --show work

  1. Read the table: every clip embedded, "starts by itself", not stretched; clicks per slide as planned; the effects on slides you did not touch equal to their count before.
  2. --show: PowerPoint exports the show of the video slides. Its length must reach the clips' total (165 s for 158.3 s of clips; clips that do not start leave about 2 s per slide), and the picture must move.
  3. PowerPoint's own effects: --show work --slides 2,4. The export plays every click step straight after the one before, inside 2 s per slide, so its length proves nothing: judge them in work/sheet.png, the frames of that show.
  4. Open the pictures and the PDF and look at them.
  5. Say what was not checked: nobody watched it in a live slide show, and PowerPoint for Mac, Keynote and Google Slides were not tried.

Working rules

  • Never write into the deck you were given (the scripts refuse to). Build in a work folder, keep the previous version under a dated name, install at the end.
  • A deck the user has edited by hand is no longer the generator's: never rebuild it from the script that first made it; change it through PowerPoint.
  • A new video slide gets notes: who presents (keep_first_note_line), that the clip starts by itself, and what to say while it plays.

Deliver

The deck and its PDF; the video slides with the seconds of each, the total time added and the file size; the clicks per slide; what was not verified; where the previous version is.

Related Skills