-
Notifications
You must be signed in to change notification settings - Fork 610
ppt animation
Attach entrance, exit, emphasis, or motion-path animations to a shape or chart. Each animation is addressable as a child of its shape/chart and exposes its timing facets (effect, trigger, duration, delay, repeat, …) individually.
Path:
/slide[N]/shape[M]/animation[K]/slide[N]/chart[M]/animation[K]
- add - Attach an animation to a shape or chart
- set - Change an existing animation's facets
- get - Read an animation's facets
- query - Find animations (
query animation) - remove - Detach an animation
Parent: shape or chart
| Property | Values | Description |
|---|---|---|
effect |
preset name (see below) | Animation preset. Entrance/exit presets: appear, fade, fly, zoom, wipe, bounce, float, swivel, split, wheel, checkerboard, blinds, dissolve, flash, box, circle, diamond, plus, strips, wedge, random. Emphasis-only: spin, grow, wave, bold (require class=emphasis). |
class |
entrance, exit, emphasis, motion
|
Animation category. spin/grow/wave only work with emphasis; motion needs path=<preset|custom>
|
path |
line, arc, circle, diamond, triangle, square, custom
|
Motion-path preset (only valid when class=motion). custom requires d=. Use class=motion + path=<preset>, not type=motionPath
|
d |
SVG-like path data | Custom motion-path data (only when class=motion and path=custom). Coords relative to slide (0..1); must end with E (auto-appended) |
trigger |
onClick, withPrevious, afterPrevious
|
When the animation starts |
duration / dur
|
milliseconds | Animation duration (e.g. 500 = 0.5s) |
delay |
milliseconds | Delay before starting |
direction |
in/out/left/right/up/down
|
Direction for directional effects (aliases top=up, bottom=down, plus l/r/u/d). Consumed at Add only |
repeat |
positive integer or indefinite
|
Number of repeats; indefinite loops forever |
restart |
always, whenNotActive, never
|
What happens when the trigger fires again |
autoReverse |
bool | Play forward then in reverse, doubling the visible run |
chartBuild |
asWhole, series, category, seriesEl, categoryEl
|
Chart-internal build (only valid when the parent is /slide[N]/chart[M]). Aliases: bySeries, byCategory, bySeriesEl, byCategoryEl. Chart-wide — setting it on any chart animation propagates to all of the chart's animations |
Exit template effects: sixteen additional exit effects (
contract,centerRevolve,collapse,floatOut,shrinkTurn,sinkDown,spinner,basicZoom,stretchy,boomerang,credits,curveDown,pinwheel,spiralOut,basicSwivel) are backed by verbatim PowerPoint OOXML templates and requireclass=exit. They ignore thedurationprop (they keep PowerPoint's authored timing). The plainfloateffect is the Exciting-menu Float; usefloatOutfor the Moderate-menu Float Out. (disappearis not supported — useclass=exitwithappearorfade.)
On Get, each facet is its own key (there is no composite animation key). In addition to the add/set facets above, Get surfaces:
| Attribute | Type | Description |
|---|---|---|
presetId |
number | Raw OOXML preset id for the effect (emitted when the effect has a recognized preset) |
easein |
number | Acceleration percentage (0..100) — fraction of duration spent ramping up |
easeout |
number | Deceleration percentage (0..100) — fraction of duration spent ramping down |
motionPath |
string | Motion-path SVG-like string (animMotion @path) for path animations |
Directional effects also emit a standalone
directionkey, and pack the facets into a value of the formeffectName-class-direction-duration(e.g.fly-entrance-left-500).
# Entrance fade
officecli add deck.pptx /slide[1]/shape[2] --type animation --prop effect=fade --prop class=entrance
# Emphasis spin (spin requires emphasis)
officecli add deck.pptx /slide[1]/shape[2] --type animation --prop effect=spin --prop class=emphasis --prop duration=2000
# Fly in from the left, after the previous animation
officecli add deck.pptx /slide[1]/shape[3] --type animation \
--prop effect=fly --prop class=entrance --prop direction=left \
--prop trigger=afterPrevious --prop duration=500
# Motion path (line, moving right)
officecli add deck.pptx /slide[1]/shape[4] --type animation --prop class=motion --prop path=line --prop direction=right
# Custom motion path
officecli add deck.pptx /slide[1]/shape[4] --type animation \
--prop class=motion --prop path=custom --prop d='M 0 0 L 0.5 0 E'
# Chart build-by-category entrance
officecli add deck.pptx /slide[2]/chart[1] --type animation \
--prop "effect=fade;class=entrance;chartBuild=byCategory"
# Loop an emphasis pulse indefinitely
officecli set deck.pptx /slide[1]/shape[2]/animation[1] --prop repeat=indefinite --prop restart=always
# Read an animation's facets
officecli get deck.pptx /slide[1]/shape[2]/animation[1]
# Find all animations
officecli query deck.pptx animation
# Remove an animation
officecli remove deck.pptx /slide[1]/shape[2]/animation[1]- An animation is attached to a shape or chart graphicFrame; chart targets additionally write
<a:bldChart bld=…/>alongside the timing tree (seechartBuild). - Motion-path anti-pattern:
--prop type=motionPathis not a valid property and produces an unsupported_property warning. Use--prop class=motion --prop path=<preset>.
- Shape - The parent shape an animation attaches to
-
Chart - Charts also accept animations (with
chartBuild) - Slide set - Slide-level transitions (distinct from per-shape animations)
- PowerPoint Reference - All PowerPoint elements
Based on OfficeCLI v1.0.119