Skip to content

AI turns documents or topics into real, native PowerPoint decks—with native shapes, transitions and animations, data-backed charts and tables on demand, audio narration from speaker notes, and support for your own .pptx templates. · by Hugo He

feat(transitions): support the complete native option surface

hugohe373f469f5440d
diff --git a/docs/animations.md b/docs/animations.md
index f2134e4a..a0bdd9eb 100644
--- a/docs/animations.md
+++ b/docs/animations.md
@@ -37,8 +37,8 @@ Changing animation settings does not require regenerating the slides. Rerun `svg
| Animate all elements together | `python3 skills/ppt-master/scripts/svg_to_pptx.py <project> -a auto --animation-trigger with-previous` |
| Slow the reveal sequence | `python3 skills/ppt-master/scripts/svg_to_pptx.py <project> -a auto --animation-duration 0.5 --animation-stagger 0.8` |
-The transition vocabulary covers all three sections in the current PowerPoint
-gallery:
+The 48 canonical transition keys cover all three sections in the current
+PowerPoint gallery:
- Subtle: `morph`, `fade`, `push`, `wipe`, `split`, `reveal`, `cut`,
`random_bars`, `shape`, `uncover`, `cover`, `flash`.
@@ -50,12 +50,20 @@ gallery:
- Dynamic Content: `pan`, `ferris_wheel`, `conveyor`, `rotate`, `window`,
`orbit`, `fly_through`.
-Compatibility aliases `strips`, `circle`, `diamond`, `newsflash`, `plus`,
-`pull`, `wedge`, and `wheel` also remain valid. They normalize to current
-gallery effects before writing: `strips` → `wipe`; `circle` / `diamond` /
-`plus` → `shape`; `newsflash` → `flash`; `pull` → `uncover`; and `wedge` /
-`wheel` → `clock`. `-t none` removes the visual effect but does not remove an
-explicitly configured auto-advance timer.
+The old names `strips`, `circle`, `diamond`, `newsflash`, `plus`, `pull`,
+`wedge`, and `wheel` remain accepted only as compatibility inputs. New
+sidecars, plans, traces, and output use canonical keys. Compatibility inputs
+desugar into a native effect plus its Effect Options—for example, `diamond`
+becomes `shape` with `shape: diamond`, and `wedge` becomes `clock` with
+`style: wedge`.
+
+Set effect-specific PowerPoint options in
+`transition.effect_options`. Direction, shape, pattern, Morph scope, black
+screen, page count, and bounce are validated against the selected effect.
+Run
+`python3 skills/ppt-master/scripts/pptx_animations.py --describe-transition <effect>`
+for the exact values. `-t none` removes the visual effect but does not remove
+an explicitly configured auto-advance timer.
## Choose a Start Mode
diff --git a/docs/zh/animations.md b/docs/zh/animations.md
index 75b5f262..384f55d4 100644
--- a/docs/zh/animations.md
+++ b/docs/zh/animations.md
@@ -35,7 +35,7 @@ OOXML,而不是嵌入视频。对象动画包括进入、强调、动作路径
| 所有元素同时入场 | `python3 skills/ppt-master/scripts/svg_to_pptx.py <project> -a auto --animation-trigger with-previous` |
| 放慢逐步揭示节奏 | `python3 skills/ppt-master/scripts/svg_to_pptx.py <project> -a auto --animation-duration 0.5 --animation-stagger 0.8` |
-页间转场已经覆盖当前 PowerPoint 效果库的三个完整分组:
+48 个规范页间切换标识已经覆盖当前 PowerPoint 效果库的三个完整分组:
- 细微:平滑 `morph`、淡入/淡出 `fade`、推入 `push`、擦除 `wipe`、
分割 `split`、显示 `reveal`、切入 `cut`、随机线条 `random_bars`、
@@ -51,11 +51,15 @@ OOXML,而不是嵌入视频。对象动画包括进入、强调、动作路径
- 动态内容:平移 `pan`、摩天轮 `ferris_wheel`、传送带 `conveyor`、
旋转 `rotate`、窗口 `window`、轨道 `orbit`、飞过 `fly_through`。
-兼容标识 `strips`、`circle`、`diamond`、`newsflash`、`plus`、`pull`、
-`wedge`、`wheel` 仍然有效,但会先归一化为当前 PowerPoint 效果库中的规范
-效果再写入:`strips` → `wipe`;`circle` / `diamond` / `plus` → `shape`;
-`newsflash` → `flash`;`pull` → `uncover`;`wedge` / `wheel` → `clock`。
-`-t none` 只关闭视觉效果,不会移除显式设置的自动翻页计时。
+旧标识 `strips`、`circle`、`diamond`、`newsflash`、`plus`、`pull`、
+`wedge`、`wheel` 只保留为兼容输入;新 sidecar、计划、轨迹和输出只使用规范
+标识。兼容输入会反糖化为一个原生效果及其效果选项,例如 `diamond` 会变成
+`shape` 加 `shape: diamond`,`wedge` 会变成 `clock` 加 `style: wedge`。
+
+原生 PowerPoint 效果选项写在 `transition.effect_options` 中。方向、形状、
+图案、Morph 范围、黑场、卷页数量和弹跳等参数都会按所选效果严格校验。运行
+`python3 skills/ppt-master/scripts/pptx_animations.py --describe-transition <effect>`
+可查看精确取值。`-t none` 只关闭视觉效果,不会移除显式设置的自动翻页计时。
## 选择 Start 模式
diff --git a/skills/ppt-master/references/animations.md b/skills/ppt-master/references/animations.md
index f1cbc08e..f86292d0 100644
--- a/skills/ppt-master/references/animations.md
+++ b/skills/ppt-master/references/animations.md
@@ -133,15 +133,22 @@ python3 skills/ppt-master/scripts/svg_to_pptx.py <project> --auto-advance 5
python3 skills/ppt-master/scripts/svg_to_pptx.py <project> -t none --auto-advance 5
```
-The named effects cover the complete current PowerPoint transition gallery:
-
-The registry covers PowerPoint's complete Subtle, Exciting, and Dynamic Content
-gallery. Run `pptx_animations.py --list` for exact identifiers.
-
-Established low-level aliases remain accepted for compatibility and normalize
-to current gallery effects: `strips` → `wipe`; `circle` / `diamond` / `plus`
-→ `shape`; `newsflash` → `flash`; `pull` → `uncover`; and `wedge` / `wheel`
-→ `clock`.
+The native registry covers PowerPoint's complete Subtle, Exciting, and Dynamic
+Content gallery: 48 canonical keys. New selection, sidecars, plans, conversion
+traces, and writers use only those keys. Run `pptx_animations.py --list` for
+the categorized identifiers.
+
+Eight old low-level names remain accepted only as compatibility inputs. They
+desugar to a native key plus native `effect_options`: for example, `diamond`
+becomes `shape` with `shape: diamond`, and `wedge` becomes `clock` with
+`style: wedge`. They are never selected for new output.
+
+Effects expose their real PowerPoint Effect Options through
+`transition.effect_options`. Common examples include Push/Wipe direction,
+Morph by object/word/character, Reveal through black, Shape geometry, Page
+Curl direction/pages, Glitter pattern/direction, and Fly Through bounce. Run
+`pptx_animations.py --describe-transition <effect>` for the exact
+effect-specific contract; unknown or inapplicable options fail validation.
`none` removes the visual effect. Effects that require newer Office namespaces
carry a real PowerPoint effect in `mc:Choice` and a `fade` fallback for older
consumers; validation requires the requested primary effect and never accepts
@@ -149,11 +156,11 @@ the fallback as a silent substitute.
Flags:
-- `-t/--transition` — effect name, or `none` for no visual transition. Default: `fade`. `none` does not remove an explicitly configured automatic advance.
+- `-t/--transition` — native effect name, compatibility input, or `none` for no visual transition. Default: `fade`. `none` does not remove an explicitly configured automatic advance.
- `--transition-duration` — seconds, default `0.4`.
- `--auto-advance` — seconds; click remains enabled, so the slide advances on click or when the timer expires. Omit for presenter-controlled advance.
-**Hard rule — no silent downgrade**: an unknown transition effect or invalid/non-finite duration fails export. It is never replaced by `fade`. Recorded narration keeps the resolved visual transition; `-t none --recorded-narration ...` writes narration-driven advance timing without restoring a visual effect.
+**Hard rule — no silent downgrade**: an unknown transition effect, unsupported Effect Option, or invalid/non-finite duration fails export. It is never replaced by `fade`. Recorded narration keeps the resolved visual transition; `-t none --recorded-narration ...` writes narration-driven advance timing without restoring a visual effect.
---
diff --git a/skills/ppt-master/scripts/README.md b/skills/ppt-master/scripts/README.md
index faffdb6e..5e2e7046 100644
--- a/skills/ppt-master/scripts/README.md
+++ b/skills/ppt-master/scripts/README.md
@@ -174,7 +174,7 @@ python3 scripts/template_fill_pptx.py apply <project_path>/sources/<source.pptx>
python3 scripts/template_fill_pptx.py validate <project_path>
```
-`apply` requires `fill_plan.json` to have top-level `"status": "confirmed"` unless `--force` is passed. It automatically writes `filled_YYYYMMDD_HHMMSS.pptx` unless the output stem already ends with a timestamp. It applies a `fade` page transition by default; `--transition <effect>` accepts any effect in the shared gallery registry documented by [`docs/pptx-transitions.md`](docs/pptx-transitions.md), and `--transition-duration <seconds>` changes its duration. `--transition none` removes the visual effect, `--transition keep` preserves the source transitions, and a per-slide `transition` field in the plan overrides whatever the CLI selects.
+`apply` requires `fill_plan.json` to have top-level `"status": "confirmed"` unless `--force` is passed. It automatically writes `filled_YYYYMMDD_HHMMSS.pptx` unless the output stem already ends with a timestamp. It applies a `fade` page transition by default; `--transition <effect>` accepts a canonical effect in the shared native gallery registry documented by [`docs/pptx-transitions.md`](docs/pptx-transitions.md), while old names remain accepted only as compatibility inputs, and `--transition-duration <seconds>` changes its duration. `--transition none` removes the visual effect, `--transition keep` preserves the source transitions, and a per-slide `transition` field in the plan overrides whatever the CLI selects. The object form accepts effect-specific native `effect_options`.
Native existing-PPTX enhancement (direct PPTX, no SVG conversion):
diff --git a/skills/ppt-master/scripts/docs/pptx-transitions.md b/skills/ppt-master/scripts/docs/pptx-transitions.md
index 62dba202..349ee8dc 100644
--- a/skills/ppt-master/scripts/docs/pptx-transitions.md
+++ b/skills/ppt-master/scripts/docs/pptx-transitions.md
@@ -24,7 +24,7 @@ must not build, replace, or patch a transition with route-local XML or regex.
| Layer | Meaning | OOXML |
|---|---|---|
-| Enter | How the current slide appears from the preceding slide | Transition effect child plus duration |
+| Enter | How the current slide appears from the preceding slide | Native effect, Effect Options, and duration |
| Advance | How the current slide leaves for the next slide | advClick and advTm |
Enter policy:
@@ -52,18 +52,25 @@ a timing-only p:transition with no visual-effect child.
## 3. Compatibility Contract
-The registry covers the complete current PowerPoint transition gallery:
-12 Subtle effects, 29 Exciting effects, and 7 Dynamic Content effects.
-Eight established low-level names remain valid compatibility inputs, but they
-normalize to current gallery effects before XML writing and read-back:
+The native registry covers the complete current PowerPoint transition gallery:
+12 Subtle effects, 29 Exciting effects, and 7 Dynamic Content effects. New
+selection, sidecars, plans, conversion traces, help, and writers use only these
+48 native keys.
-| Compatibility input | Canonical gallery effect |
+Eight established low-level names remain valid at input boundaries. They
+normalize to one native effect plus native `effect_options`; they are not a
+second transition registry:
+
+| Compatibility input | Native request |
|---|---|
-| `strips` | `wipe` |
-| `circle`, `diamond`, `plus` | `shape` |
+| `strips` | `wipe` with `direction: right` |
+| `circle` | `shape` with `shape: circle` |
+| `diamond` | `shape` with `shape: diamond` |
+| `plus` | `shape` with `shape: plus` |
| `newsflash` | `flash` |
| `pull` | `uncover` |
-| `wedge`, `wheel` | `clock` |
+| `wedge` | `clock` with `style: wedge` |
+| `wheel` | `clock` with `style: clockwise` |
Standard PresentationML effects use a direct `p:transition` carrier:
@@ -72,19 +79,19 @@ Standard PresentationML effects use a direct `p:transition` carrier:
| fade | p:fade |
| push | p:push dir=r |
| wipe | p:wipe dir=r |
-| split | p:split orient=horz dir=out |
-| cut | p:cut thruBlk=0 |
+| split | p:split |
+| cut | p:cut |
| random_bars | p:randomBar dir=vert |
| shape | p:circle |
| uncover | p:pull dir=r |
| cover | p:cover dir=r |
| dissolve | p:dissolve |
-| checkerboard | p:checker dir=horz |
+| checkerboard | p:checker |
| blinds | p:blinds dir=vert |
| clock | p:wheel spokes=1 |
| random | p:random |
| box | p:zoom |
-| comb | p:comb dir=horz |
+| comb | p:comb |
Office 2010 effects use a `p14` Choice with a `p:fade` Fallback:
@@ -131,6 +138,61 @@ Office 2012 effects use a `p15` Choice with a `p:fade` Fallback:
`p:fade` Fallback. `none` is the explicit no-visual-effect input and therefore
is not a registry entry.
+### 3.1 Native Effect Options
+
+Use `effect_options` only with an explicit native `effect`. Omitted options use
+the PowerPoint-authored `default` reported by `--describe-transition`:
+
+| Effect | Supported options |
+|---|---|
+| `morph` | `morph_by`: `object`, `word`, `character` |
+| `fade` | `style`: `smoothly`, `through_black` |
+| `push`, `wipe`, `vortex`, `cube`, `pan`, `rotate`, `orbit` | `direction`: `left`, `right`, `up`, `down` |
+| `split` | `orientation`: `horizontal`, `vertical`; `direction`: `out`, `in` |
+| `reveal` | `direction`: `right`, `left`; `through_black`: boolean |
+| `cut` | `through_black`: boolean |
+| `random_bars`, `blinds`, `doors` | `orientation`: `vertical`, `horizontal` |
+| `checkerboard` | `direction`: `across`, `down` |
+| `comb`, `window` | `orientation`: `horizontal`, `vertical` |
+| `shape` | `shape`: `circle`, `diamond`, `plus` |
+| `uncover`, `cover` | `direction`: `left`, `right`, `up`, `down`, `up_left`, `up_right`, `down_left`, `down_right` |
+| `fall_over`, `drape`, `wind`, `peel_off`, `airplane`, `origami` | `direction`: `right`, `left` |
+| `page_curl` | `direction`: `right`, `left`; `pages`: `single`, `double` |
+| `clock` | `style`: `clockwise`, `counterclockwise`, `wedge` |
+| `ripple` | `origin`: `center`, `up_left`, `up_right`, `down_left`, `down_right` |
+| `glitter` | `shape`: `diamond`, `hexagon`; `direction`: `right`, `left`, `up`, `down` |
+| `shred` | `pattern`: `strips`, `rectangle`; `direction`: `out`, `in` |
+| `switch`, `flip`, `gallery`, `ferris_wheel`, `conveyor` | `direction`: `right`, `left` |
+| `box`, `zoom` | `direction`: `out`, `in` |
+| `fly_through` | `direction`: `in`, `out`; `bounce`: boolean |
+| All other native effects | No Effect Options |
+
+Example:
+
+~~~json
+{
+ "transition": {
+ "effect": "page_curl",
+ "effect_options": {
+ "direction": "left",
+ "pages": "double"
+ },
+ "duration": 0.6
+ }
+}
+~~~
+
+Inspect the exact contract, including compatibility desugaring:
+
+~~~bash
+python3 skills/ppt-master/scripts/pptx_animations.py --describe-transition page_curl
+python3 skills/ppt-master/scripts/pptx_animations.py --describe-transition diamond
+~~~
+
+Read-back reports the canonical native effect, its complete effective options,
+the raw OOXML child, and raw attributes. This makes option loss a validation
+failure rather than a silent downgrade.
+
**Hard rule — no downgrade**:
- Never rename or remove an established effect.
@@ -200,6 +262,8 @@ into ppt/presentation.xml.
Reject:
- unknown effect names;
+- options without an explicit native effect;
+- unknown option fields or values for the selected effect;
- non-finite values, including NaN and Infinity;
- duration less than or equal to zero;
- negative advance or narration padding;
@@ -207,9 +271,11 @@ Reject:
- multiple logical transition carriers;
- unresolved MCE Requires or Ignorable prefixes.
-Read-back must report the primary Choice effect separately from the fallback.
-It must also report carrier type, duration, click mode, and automatic advance
-time. Package validation must run after writing, not only before mutation.
+Read-back must report the canonical native effect and complete effective
+options, while keeping the primary Choice child separate from the fallback. It
+must also report raw effect attributes, carrier type, duration, click mode, and
+automatic advance time. Package validation must run after writing, not only
+before mutation.
Use inline smoke commands and gitignored projects/_smoke_* artifacts. Do not
add a tests directory or test_*.py files.
diff --git a/skills/ppt-master/scripts/native_enhance_pptx_core.py b/skills/ppt-master/scripts/native_enhance_pptx_core.py
index 0cf2bd23..19c88706 100644
--- a/skills/ppt-master/scripts/native_enhance_pptx_core.py
+++ b/skills/ppt-master/scripts/native_enhance_pptx_core.py
@@ -50,8 +50,10 @@ from pptx_animations import ( # noqa: E402
from pptx_transitions import ( # noqa: E402
AdvanceUpdate,
EnterUpdate,
- TRANSITIONS,
+ LEGACY_TRANSITION_KEYS,
+ NATIVE_TRANSITION_KEYS,
apply_slide_motion_xml,
+ normalize_transition_effect_request,
set_directory_use_timings,
validate_pptx_transition_package,
validate_seconds,
@@ -448,32 +450,63 @@ def _resolve_enter_update(
*,
cli_effect: str | None,
configured_effect: object,
+ configured_effect_options: object = None,
transitions_enabled: bool,
duration: float,
) -> EnterUpdate:
if cli_effect is None and not transitions_enabled:
if configured_effect == "none":
+ normalize_transition_effect_request(
+ configured_effect,
+ configured_effect_options,
+ )
return EnterUpdate(policy="none", effect=None, duration=duration)
return EnterUpdate(policy="preserve", duration=duration)
effect = cli_effect if cli_effect is not None else configured_effect
- if not isinstance(effect, str):
- raise ValueError(f"transition effect must be a string: {effect!r}")
if effect == "none":
- return EnterUpdate(policy="none", effect=None, duration=duration)
- if effect not in TRANSITIONS:
- valid = ", ".join(sorted(TRANSITIONS))
- raise ValueError(
- f"unknown transition effect {effect!r}; valid effects: {valid}, none"
+ normalize_transition_effect_request(
+ effect,
+ None if cli_effect is not None else configured_effect_options,
)
+ return EnterUpdate(policy="none", effect=None, duration=duration)
+ effect, effect_options = normalize_transition_effect_request(
+ effect,
+ None if cli_effect is not None else configured_effect_options,
+ allow_none=False,
+ )
- return EnterUpdate(policy="replace", effect=effect, duration=duration)
+ return EnterUpdate(
+ policy="replace",
+ effect=effect,
+ duration=duration,
+ effect_options=effect_options,
+ )
def _plan_confirmed(plan: dict) -> bool:
return plan.get("status") == "confirmed"
+def _native_transition_config(
+ transition: str,
+ duration: float,
+) -> dict[str, object]:
+ if transition == "none":
+ return {"effect": "none", "duration": duration}
+ effect, effect_options = normalize_transition_effect_request(
+ transition,
+ allow_none=False,
+ )
+ config: dict[str, object] = {
+ "effect": effect,
+ "duration": duration,
+ }
+ if effect_options:
+ config["effect_options"] = effect_options
+ return config
+
+
def _build_enhancement_plan(
project: dict,
*,
@@ -485,6 +518,10 @@ def _build_enhancement_plan(
narration_padding: float,
apply_transition_without_audio: bool,
) -> dict:
+ transition_config = _native_transition_config(
+ transition,
+ transition_duration,
+ )
return {
"schema": "native_pptx_enhancement_plan.v1",
"status": "draft",
@@ -514,8 +551,7 @@ def _build_enhancement_plan(
"enabled": transition != "none",
"requires_confirmation": True,
"status": "ready",
- "effect": transition,
- "duration": transition_duration,
+ **transition_config,
"apply_without_audio": apply_transition_without_audio,
},
},
@@ -601,10 +637,10 @@ def init_project(args: argparse.Namespace) -> int:
"notes_dir": "notes",
"audio_dir": "audio",
"exports_dir": "exports",
- "transition": {
- "effect": args.transition,
- "duration": args.transition_duration,
- },
+ "transition": _native_transition_config(
+ args.transition,
+ args.transition_duration,
+ ),
"audio": {
"provider": "",
"voice": "",
@@ -698,12 +734,26 @@ def apply_project(args: argparse.Namespace) -> int:
if not isinstance(timings_cfg, dict):
timings_cfg = {}
+ transition_options_without_effect = (
+ (
+ "effect_options" in transitions_cfg
+ and "effect" not in transitions_cfg
+ )
+ or (
+ "effect_options" in transition_cfg
+ and "effect" not in transition_cfg
+ and "effect" not in transitions_cfg
+ )
+ )
if "effect" in transitions_cfg:
configured_effect = transitions_cfg["effect"]
+ configured_effect_options = transitions_cfg.get("effect_options")
elif "effect" in transition_cfg:
configured_effect = transition_cfg["effect"]
+ configured_effect_options = transition_cfg.get("effect_options")
else:
configured_effect = "fade"
+ configured_effect_options = None
if args.transition_duration is not None:
raw_transition_duration = args.transition_duration
@@ -722,6 +772,10 @@ def apply_project(args: argparse.Namespace) -> int:
raw_narration_padding = 0.4
try:
+ if args.transition is None and transition_options_without_effect:
+ raise ValueError(
+ "transition effect_options requires an explicit effect"
+ )
if args.transition is not None or "transitions" in modules:
transition_duration = validate_seconds(
raw_transition_duration,
@@ -741,6 +795,7 @@ def apply_project(args: argparse.Namespace) -> int:
enter_update = _resolve_enter_update(
cli_effect=args.transition,
configured_effect=configured_effect,
+ configured_effect_options=configured_effect_options,
transitions_enabled="transitions" in modules,
duration=transition_duration,
)
@@ -919,7 +974,8 @@ def build_parser() -> argparse.ArgumentParser:
init.add_argument(
"--transition",
default="fade",
- choices=sorted(TRANSITIONS.keys()) + ["none"],
+ choices=[*NATIVE_TRANSITION_KEYS, *LEGACY_TRANSITION_KEYS, "none"],
+ help="PowerPoint-native effect; old names are compatibility inputs",
)
init.add_argument("--transition-duration", type=_positive_seconds_arg, default=0.5)
init.add_argument("--narration-padding", type=_non_negative_seconds_arg, default=0.4)
@@ -932,7 +988,12 @@ def build_parser() -> argparse.ArgumentParser:
plan = subparsers.add_parser("plan", help="draft an enhancement module plan")
plan.add_argument("project_path", help="native enhancement project directory")
- plan.add_argument("--transition", default="fade", choices=sorted(TRANSITIONS.keys()) + ["none"])
+ plan.add_argument(
+ "--transition",
+ default="fade",
+ choices=[*NATIVE_TRANSITION_KEYS, *LEGACY_TRANSITION_KEYS, "none"],
+ help="PowerPoint-native effect; old names are compatibility inputs",
+ )
plan.add_argument("--transition-duration", type=_positive_seconds_arg, default=0.5)
plan.add_argument("--narration-padding", type=_non_negative_seconds_arg, default=0.4)
plan.add_argument(
@@ -946,7 +1007,12 @@ def build_parser() -> argparse.ArgumentParser:
apply.add_argument("project_path", help="native enhancement project directory")
apply.add_argument("-o", "--output", default=None, help="output .pptx path")
apply.add_argument("--overwrite", action="store_true", help="overwrite output if it exists")
- apply.add_argument("--transition", default=None, choices=sorted(TRANSITIONS.keys()) + ["none"])
+ apply.add_argument(
+ "--transition",
+ default=None,
+ choices=[*NATIVE_TRANSITION_KEYS, *LEGACY_TRANSITION_KEYS, "none"],
+ help="PowerPoint-native effect; old names are compatibility inputs",
+ )
apply.add_argument("--transition-duration", type=_positive_seconds_arg, default=None)
apply.add_argument("--narration-padding", type=_non_negative_seconds_arg, default=None)
apply.add_argument("--force", action="store_true", help="apply without a confirmed enhancement plan")
diff --git a/skills/ppt-master/scripts/pptx_animations.py b/skills/ppt-master/scripts/pptx_animations.py
index a6752640..525565b9 100644
--- a/skills/ppt-master/scripts/pptx_animations.py
+++ b/skills/ppt-master/scripts/pptx_animations.py
@@ -74,12 +74,17 @@ from xml.etree import ElementTree as ET
from console_encoding import configure_utf8_stdio
from pptx_transitions import (
+ LEGACY_TRANSITION_KEYS,
MAX_OOXML_MILLISECONDS,
MAX_OOXML_UNSIGNED_INT,
+ NATIVE_TRANSITION_KEYS,
+ NATIVE_TRANSITIONS,
PML_NS,
+ TRANSITION_ALIAS_OPTIONS,
TRANSITION_ALIASES,
- TRANSITIONS,
+ TRANSITION_CATEGORIES,
create_transition_xml,
+ describe_transition_effect,
validate_seconds,
)
@@ -3383,8 +3388,8 @@ def entrance_animation_fingerprint(slide_xml: str | bytes) -> str | None:
def get_available_transitions() -> list:
- """Get a list of all available transition effects"""
- return list(TRANSITIONS.keys())
+ """Get native transition keys followed by compatibility inputs."""
+ return [*NATIVE_TRANSITION_KEYS, *LEGACY_TRANSITION_KEYS]
def get_available_animations() -> list:
@@ -3393,12 +3398,23 @@ def get_available_animations() -> list:
def get_transition_help() -> str:
- """Get help text for transition effects"""
+ """Get categorized native transitions plus legacy compatibility inputs."""
lines = ["Available transition effects:"]
- for key, info in TRANSITIONS.items():
- alias = TRANSITION_ALIASES.get(key)
- suffix = f" (compatibility alias for {alias})" if alias else ""
- lines.append(f" {key}: {info['name']}{suffix}")
+ for category in TRANSITION_CATEGORIES:
+ lines.append(f" PowerPoint-native {category} effects:")
+ for key in NATIVE_TRANSITION_KEYS:
+ info = NATIVE_TRANSITIONS[key]
+ if info["category"] == category:
+ lines.append(f" {key}: {info['name']}")
+ lines.append(" Legacy compatibility inputs (never selected for new output):")
+ for key in LEGACY_TRANSITION_KEYS:
+ canonical = TRANSITION_ALIASES[key]
+ implied = TRANSITION_ALIAS_OPTIONS.get(key)
+ option_suffix = f", implies {implied}" if implied else ""
+ lines.append(
+ f" {key}: compatibility alias for {canonical} "
+ f"({NATIVE_TRANSITIONS[canonical]['name']}{option_suffix})"
+ )
return '\n'.join(lines)
@@ -3504,6 +3520,11 @@ def main() -> None:
metavar='EFFECT',
help='print the complete parameter contract for one object animation',
)
+ parser.add_argument(
+ '--describe-transition',
+ metavar='EFFECT',
+ help='print the PowerPoint Effect Options for one page transition',
+ )
args = parser.parse_args()
if args.describe:
@@ -3519,6 +3540,19 @@ def main() -> None:
parser.error(str(exc))
return
+ if args.describe_transition:
+ try:
+ print(
+ json.dumps(
+ describe_transition_effect(args.describe_transition),
+ ensure_ascii=False,
+ indent=2,
+ )
+ )
+ except ValueError as exc:
+ parser.error(str(exc))
+ return
+
if args.list:
print(get_transition_help())
print()
diff --git a/skills/ppt-master/scripts/pptx_transitions.py b/skills/ppt-master/scripts/pptx_transitions.py
index 9dc15dfd..9ceebaf3 100644
--- a/skills/ppt-master/scripts/pptx_transitions.py
+++ b/skills/ppt-master/scripts/pptx_transitions.py
@@ -2,8 +2,9 @@
"""
PPT Master - PPTX Transition Core
-Provide one strict transition registry plus shared OOXML read/write helpers for
-generated slides, template-filled PPTX files, and native PPTX enhancement.
+Provide one strict PowerPoint-native transition registry, a compatibility input
+map, and shared OOXML read/write helpers for generated slides, template-filled
+PPTX files, and native PPTX enhancement.
See references/animations.md for the public workflow and
scripts/docs/pptx-transitions.md for the OOXML contract.
@@ -24,9 +25,9 @@ import math
import posixpath
import re
import zipfile
-from dataclasses import dataclass
+from dataclasses import dataclass, field
from pathlib import Path
-from typing import Any, MutableMapping
+from typing import Any, Mapping, MutableMapping
from xml.etree import ElementTree as ET
from xml.sax.saxutils import quoteattr
@@ -62,9 +63,8 @@ MAX_OOXML_MILLISECONDS = 4_294_967_295
MAX_OOXML_UNSIGNED_INT = MAX_OOXML_MILLISECONDS
-CANONICAL_TRANSITIONS: dict[str, dict[str, Any]] = {
- # Public ordering is assembled below so the original seven input names
- # remain stable even though compatibility aliases normalize immediately.
+_TRANSITION_SPECS: dict[str, dict[str, Any]] = {
+ # PowerPoint-native public ordering is assembled by gallery category below.
"fade": {
"name": "Fade",
"element": "fade",
@@ -374,6 +374,481 @@ CANONICAL_TRANSITIONS: dict[str, dict[str, Any]] = {
},
}
+TRANSITION_CATEGORIES = ("subtle", "exciting", "dynamic_content")
+_TRANSITION_KEYS_BY_CATEGORY = {
+ "subtle": (
+ "morph",
+ "fade",
+ "push",
+ "wipe",
+ "split",
+ "reveal",
+ "cut",
+ "random_bars",
+ "shape",
+ "uncover",
+ "cover",
+ "flash",
+ ),
+ "exciting": (
+ "fall_over",
+ "drape",
+ "curtains",
+ "wind",
+ "prestige",
+ "fracture",
+ "crush",
+ "peel_off",
+ "page_curl",
+ "airplane",
+ "origami",
+ "dissolve",
+ "checkerboard",
+ "blinds",
+ "clock",
+ "ripple",
+ "honeycomb",
+ "glitter",
+ "vortex",
+ "shred",
+ "switch",
+ "flip",
+ "gallery",
+ "cube",
+ "doors",
+ "box",
+ "comb",
+ "zoom",
+ "random",
+ ),
+ "dynamic_content": (
+ "pan",
+ "ferris_wheel",
+ "conveyor",
+ "rotate",
+ "window",
+ "orbit",
+ "fly_through",
+ ),
+}
+
+TRANSITION_EFFECT_OPTION_FIELDS = (
+ "direction",
+ "orientation",
+ "style",
+ "shape",
+ "pattern",
+ "origin",
+ "pages",
+ "morph_by",
+ "through_black",
+ "bounce",
+)
+
+
+def _enum_option(
+ default: str,
+ values: Mapping[str, Mapping[str, Any]],
+) -> dict[str, Any]:
+ return {
+ "type": "enum",
+ "default": default,
+ "values": dict(values),
+ }
+
+
+def _attribute_enum(
+ default: str,
+ attribute: str,
+ values: Mapping[str, str | None],
+) -> dict[str, Any]:
+ overrides: dict[str, dict[str, Any]] = {}
+ for name, value in values.items():
+ if value is None:
+ overrides[name] = {"remove_attrs": (attribute,)}
+ else:
+ overrides[name] = {"attrs": {attribute: value}}
+ return _enum_option(default, overrides)
+
+
+def _boolean_option(
+ default: bool,
+ attribute: str,
+) -> dict[str, Any]:
+ return {
+ "type": "boolean",
+ "default": default,
+ "values": {
+ False: {"remove_attrs": (attribute,)},
+ True: {"attrs": {attribute: "1"}},
+ },
+ }
+
+
+_CARDINAL_DIRECTIONS = {
+ "left": None,
+ "right": "r",
+ "up": "u",
+ "down": "d",
+}
+_CORNER_DIRECTIONS = {
+ **_CARDINAL_DIRECTIONS,
+ "up_left": "lu",
+ "up_right": "ru",
+ "down_left": "ld",
+ "down_right": "rd",
+}
+_TRANSITION_EFFECT_OPTIONS: dict[str, dict[str, dict[str, Any]]] = {
+ "morph": {
+ "morph_by": _attribute_enum(
+ "object",
+ "option",
+ {
+ "object": "byObject",
+ "word": "byWord",
+ "character": "byChar",
+ },
+ ),
+ },
+ "fade": {
+ "style": _attribute_enum(
+ "smoothly",
+ "thruBlk",
+ {"smoothly": None, "through_black": "1"},
+ ),
+ },
+ "push": {
+ "direction": _attribute_enum("right", "dir", _CARDINAL_DIRECTIONS),
+ },
+ "wipe": {
+ "direction": _attribute_enum("right", "dir", _CARDINAL_DIRECTIONS),
+ },
+ "split": {
+ "orientation": _attribute_enum(
+ "horizontal",
+ "orient",
+ {"horizontal": None, "vertical": "vert"},
+ ),
+ "direction": _attribute_enum(
+ "out",
+ "dir",
+ {"in": "in", "out": None},
+ ),
+ },
+ "reveal": {
+ "direction": _attribute_enum(
+ "right",
+ "dir",
+ {"left": None, "right": "r"},
+ ),
+ "through_black": _boolean_option(False, "thruBlk"),
+ },
+ "cut": {
+ "through_black": {
+ "type": "boolean",
+ "default": False,
+ "values": {
+ False: {"remove_attrs": ("thruBlk",)},
+ True: {"attrs": {"thruBlk": "1"}},
+ },
+ },
+ },
+ "random_bars": {
+ "orientation": _attribute_enum(
+ "vertical",
+ "dir",
+ {"horizontal": None, "vertical": "vert"},
+ ),
+ },
+ "shape": {
+ "shape": _enum_option(
+ "circle",
+ {
+ "circle": {"element": "circle"},
+ "diamond": {"element": "diamond"},
+ "plus": {"element": "plus"},
+ },
+ ),
+ },
+ "uncover": {
+ "direction": _attribute_enum("right", "dir", _CORNER_DIRECTIONS),
+ },
+ "cover": {
+ "direction": _attribute_enum("right", "dir", _CORNER_DIRECTIONS),
+ },
+ "fall_over": {
+ "direction": _attribute_enum(
+ "right",
+ "invX",
+ {"left": None, "right": "1"},
+ ),
+ },
+ "drape": {
+ "direction": _attribute_enum(
+ "right",
+ "invX",
+ {"left": None, "right": "1"},
+ ),
+ },
+ "wind": {
+ "direction": _attribute_enum(
+ "right",
+ "invX",
+ {"left": "1", "right": None},
+ ),
+ },
+ "peel_off": {
+ "direction": _attribute_enum(
+ "right",
+ "invX",
+ {"left": None, "right": "1"},
+ ),
+ },
+ "page_curl": {
+ "direction": _attribute_enum(
+ "right",
+ "invX",
+ {"left": None, "right": "1"},
+ ),
+ "pages": _attribute_enum(
+ "single",
+ "prst",
+ {"single": "pageCurlSingle", "double": "pageCurlDouble"},
+ ),
+ },
+ "airplane": {
+ "direction": _attribute_enum(
+ "right",
+ "invX",
+ {"left": "1", "right": None},
+ ),
+ },
+ "origami": {
+ "direction": _attribute_enum(
+ "right",
+ "invX",
+ {"left": "1", "right": None},
+ ),
+ },
+ "checkerboard": {
+ "direction": _attribute_enum(
+ "across",
+ "dir",
+ {"across": None, "down": "vert"},
+ ),
+ },
+ "blinds": {
+ "orientation": _attribute_enum(
+ "vertical",
+ "dir",
+ {"horizontal": None, "vertical": "vert"},
+ ),
+ },
+ "clock": {
+ "style": _enum_option(
+ "clockwise",
+ {
+ "clockwise": {
+ "element": "wheel",
+ "attrs": {"spokes": "1"},
+ },
+ "counterclockwise": {
+ "prefix": "p14",
+ "element": "wheelReverse",
+ "attrs": {"spokes": "1"},
+ "fallback": "fade",
+ },
+ "wedge": {
+ "element": "wedge",
+ "remove_attrs": ("spokes",),
+ },
+ },
+ ),
+ },
+ "ripple": {
+ "origin": _attribute_enum(
+ "center",
+ "dir",
+ {
+ "center": None,
+ "up_left": "lu",
+ "up_right": "ru",
+ "down_left": "ld",
+ "down_right": "rd",
+ },
+ ),
+ },
+ "glitter": {
+ "shape": _attribute_enum(
+ "diamond",
+ "pattern",
+ {"diamond": None, "hexagon": "hexagon"},
+ ),
+ "direction": _attribute_enum(
+ "right",
+ "dir",
+ {
+ "left": "r",
+ "right": None,
+ "up": "d",
+ "down": "u",
+ },
+ ),
+ },
+ "vortex": {
+ "direction": _attribute_enum("right", "dir", _CARDINAL_DIRECTIONS),
+ },
+ "shred": {
+ "pattern": _attribute_enum(
+ "strips",
+ "pattern",
+ {"strips": None, "rectangle": "rectangle"},
+ ),
+ "direction": _attribute_enum(
+ "out",
+ "dir",
+ {"in": None, "out": "out"},
+ ),
+ },
+ "switch": {
+ "direction": _attribute_enum(
+ "right",
+ "dir",
+ {"left": "l", "right": "r"},
+ ),
+ },
+ "flip": {
+ "direction": _attribute_enum(
+ "right",
+ "dir",
+ {"left": "l", "right": "r"},
+ ),
+ },
+ "gallery": {
+ "direction": _attribute_enum(
+ "right",
+ "dir",
+ {"left": "l", "right": "r"},
+ ),
+ },
+ "cube": {
+ "direction": _attribute_enum("right", "dir", _CARDINAL_DIRECTIONS),
+ },
+ "doors": {
+ "orientation": _attribute_enum(
+ "vertical",
+ "dir",
+ {"horizontal": None, "vertical": "vert"},
+ ),
+ },
+ "box": {
+ "direction": _attribute_enum(
+ "out",
+ "dir",
+ {"in": "in", "out": None},
+ ),
+ },
+ "comb": {
+ "orientation": _attribute_enum(
+ "horizontal",
+ "dir",
+ {"horizontal": None, "vertical": "vert"},
+ ),
+ },
+ "zoom": {
+ "direction": _attribute_enum(
+ "in",
+ "dir",
+ {"in": "in", "out": None},
+ ),
+ },
+ "pan": {
+ "direction": _attribute_enum("right", "dir", _CARDINAL_DIRECTIONS),
+ },
+ "ferris_wheel": {
+ "direction": _attribute_enum(
+ "right",
+ "dir",
+ {"left": "l", "right": "r"},
+ ),
+ },
+ "conveyor": {
+ "direction": _attribute_enum(
+ "right",
+ "dir",
+ {"left": "l", "right": "r"},
+ ),
+ },
+ "rotate": {
+ "direction": _attribute_enum("right", "dir", _CARDINAL_DIRECTIONS),
+ },
+ "window": {
+ "orientation": _attribute_enum(
+ "horizontal",
+ "dir",
+ {"horizontal": None, "vertical": "vert"},
+ ),
+ },
+ "orbit": {
+ "direction": _attribute_enum("right", "dir", _CARDINAL_DIRECTIONS),
+ },
+ "fly_through": {
+ "direction": _attribute_enum(
+ "in",
+ "dir",
+ {"in": None, "out": "out"},
+ ),
+ "bounce": _boolean_option(False, "hasBounce"),
+ },
+}
+
+NATIVE_TRANSITIONS: dict[str, dict[str, Any]] = {}
+for _category in TRANSITION_CATEGORIES:
+ for _key in _TRANSITION_KEYS_BY_CATEGORY[_category]:
+ if _key in NATIVE_TRANSITIONS:
+ raise RuntimeError(f"duplicate native transition key: {_key}")
+ _spec = dict(_TRANSITION_SPECS[_key])
+ _spec["category"] = _category
+ _spec["effectOptions"] = _TRANSITION_EFFECT_OPTIONS.get(_key, {})
+ NATIVE_TRANSITIONS[_key] = _spec
+if set(NATIVE_TRANSITIONS) != set(_TRANSITION_SPECS):
+ raise RuntimeError("native transition gallery categories are incomplete")
+if len(NATIVE_TRANSITIONS) != 48:
+ raise RuntimeError(
+ f"native transition gallery count changed: {len(NATIVE_TRANSITIONS)}"
+ )
+for _key, _spec in NATIVE_TRANSITIONS.items():
+ _options = _spec["effectOptions"]
+ _unknown_options = set(_options) - set(TRANSITION_EFFECT_OPTION_FIELDS)
+ if _unknown_options:
+ raise RuntimeError(
+ f"native transition {_key!r} has unknown effect option(s): "
+ + ", ".join(sorted(_unknown_options))
+ )
+ for _option_name, _option_spec in _options.items():
+ if _option_spec.get("type") not in {"enum", "boolean"}:
+ raise RuntimeError(
+ f"native transition {_key!r} option {_option_name!r} "
+ "must be enum or boolean"
+ )
+ _values = _option_spec.get("values")
+ if not isinstance(_values, dict) or not _values:
+ raise RuntimeError(
+ f"native transition {_key!r} option {_option_name!r} "
+ "must define values"
+ )
+ if _option_spec.get("default") not in _values:
+ raise RuntimeError(
+ f"native transition {_key!r} option {_option_name!r} "
+ "has an unknown default"
+ )
+
+NATIVE_TRANSITION_KEYS = tuple(NATIVE_TRANSITIONS)
+# Retained as a module-level compatibility name for existing imports. New code
+# should use ``NATIVE_TRANSITIONS`` to distinguish the native registry from
+# accepted legacy input names.
+CANONICAL_TRANSITIONS = NATIVE_TRANSITIONS
+
TRANSITION_ALIASES: dict[str, str] = {
"strips": "wipe",
"circle": "shape",
@@ -384,9 +859,18 @@ TRANSITION_ALIASES: dict[str, str] = {
"wedge": "clock",
"wheel": "clock",
}
-TRANSITIONS: dict[str, dict[str, Any]] = dict(CANONICAL_TRANSITIONS)
+LEGACY_TRANSITION_KEYS = tuple(TRANSITION_ALIASES)
+TRANSITION_ALIAS_OPTIONS: dict[str, dict[str, object]] = {
+ "strips": {"direction": "right"},
+ "circle": {"shape": "circle"},
+ "diamond": {"shape": "diamond"},
+ "plus": {"shape": "plus"},
+ "wedge": {"style": "wedge"},
+ "wheel": {"style": "clockwise"},
+}
+TRANSITIONS: dict[str, dict[str, Any]] = dict(NATIVE_TRANSITIONS)
for _alias, _canonical_key in TRANSITION_ALIASES.items():
- TRANSITIONS[_alias] = CANONICAL_TRANSITIONS[_canonical_key]
+ TRANSITIONS[_alias] = NATIVE_TRANSITIONS[_canonical_key]
TRANSITION_NAMESPACES = {
"p": PML_NS,
@@ -412,6 +896,7 @@ class EnterUpdate:
policy: str = "replace"
effect: str | None = DEFAULT_TRANSITION
duration: float = DEFAULT_TRANSITION_DURATION
+ effect_options: Mapping[str, object] | None = None
@dataclass(frozen=True)
@@ -436,6 +921,9 @@ class TransitionSummary:
speed: str | None = None
advance_on_click: bool | None = None
advance_after_ms: int | None = None
+ effect_attributes: Mapping[str, str] = field(default_factory=dict)
+ canonical_effect: str | None = None
+ effect_options: Mapping[str, object] = field(default_factory=dict)
def _qn(namespace: str, tag: str) -> str:
@@ -486,19 +974,145 @@ def validate_seconds(
def normalize_transition_effect(effect: object, *, allow_none: bool = True) -> str | None:
- """Return a known transition effect without silently changing it."""
+ """Return one canonical PowerPoint transition or explicit no-effect."""
if effect is None or effect == "none":
if allow_none:
return None
raise ValueError("transition effect is required")
if not isinstance(effect, str):
raise ValueError(f"transition effect must be a string: {effect!r}")
- if effect not in TRANSITIONS:
- valid = ", ".join(sorted(TRANSITIONS))
+ if effect in TRANSITION_ALIASES:
+ return TRANSITION_ALIASES[effect]
+ if effect in NATIVE_TRANSITIONS:
+ return effect
+ valid = ", ".join((*NATIVE_TRANSITION_KEYS, *LEGACY_TRANSITION_KEYS))
+ raise ValueError(
+ f"unknown transition effect {effect!r}; valid effects: {valid}, none"
+ )
+
+
+def normalize_transition_effect_options(
+ effect: str,
+ options: object = None,
+) -> dict[str, object]:
+ """Validate PowerPoint Effect Options for one native transition."""
+ if effect not in NATIVE_TRANSITIONS:
+ if options in (None, {}):
+ return {}
+ raise ValueError(
+ "transition effect_options require one explicit native effect; "
+ f"found {effect!r}"
+ )
+ if options is None:
+ options = {}
+ if not isinstance(options, Mapping):
raise ValueError(
- f"unknown transition effect {effect!r}; valid effects: {valid}, none"
+ f"transition effect_options must be an object: {options!r}"
)
- return TRANSITION_ALIASES.get(effect, effect)
+
+ option_specs = NATIVE_TRANSITIONS[effect]["effectOptions"]
+ unknown = set(options) - set(option_specs)
+ if unknown:
+ unsupported = ", ".join(sorted(unknown))
+ supported = ", ".join(option_specs) or "(none)"
+ raise ValueError(
+ f"transition effect {effect!r} does not support effect option(s): "
+ f"{unsupported}; supported options: {supported}"
+ )
+
+ normalized: dict[str, object] = {}
+ for name, value in options.items():
+ spec = option_specs[name]
+ field = f"transition effect_options.{name}"
+ if spec["type"] == "enum":
+ if not isinstance(value, str) or value not in spec["values"]:
+ valid = ", ".join(spec["values"])
+ raise ValueError(
+ f"{field} for {effect!r} must be one of {valid}: {value!r}"
+ )
+ normalized[name] = value
+ elif spec["type"] == "boolean":
+ if not isinstance(value, bool):
+ raise ValueError(f"{field} must be a boolean: {value!r}")
+ normalized[name] = value
+ else:
+ raise AssertionError(
+ f"unhandled transition option type: {spec['type']!r}"
+ )
+ return normalized
+
+
+def normalize_transition_effect_request(
+ effect: object,
+ options: object = None,
+ *,
+ allow_none: bool = True,
+) -> tuple[str | None, dict[str, object]]:
+ """Normalize one native effect plus options and legacy semantic aliases."""
+ raw_effect = effect
+ canonical = normalize_transition_effect(effect, allow_none=allow_none)
+ alias_options = (
+ TRANSITION_ALIAS_OPTIONS.get(raw_effect, {})
+ if isinstance(raw_effect, str)
+ else {}
+ )
+ explicit_options: Mapping[str, object]
+ if options is None:
+ explicit_options = {}
+ elif isinstance(options, Mapping):
+ explicit_options = options
+ else:
+ raise ValueError(
+ f"transition effect_options must be an object: {options!r}"
+ )
+ for name, alias_value in alias_options.items():
+ if name in explicit_options and explicit_options[name] != alias_value:
+ raise ValueError(
+ f"legacy transition effect {raw_effect!r} implies "
+ f"effect_options.{name}={alias_value!r}, which conflicts with "
+ f"{explicit_options[name]!r}"
+ )
+ merged = {**alias_options, **explicit_options}
+ if canonical is None:
+ if merged:
+ raise ValueError(
+ "transition effect_options require one explicit native effect; "
+ "found 'none'"
+ )
+ return None, {}
+ return canonical, normalize_transition_effect_options(canonical, merged)
+
+
+def describe_transition_effect(effect: object) -> dict[str, Any]:
+ """Return the author-facing parameter contract for one transition."""
+ canonical, implied_options = normalize_transition_effect_request(
+ effect,
+ allow_none=False,
+ )
+ option_contract: dict[str, Any] = {}
+ for name, raw_spec in NATIVE_TRANSITIONS[canonical]["effectOptions"].items():
+ option_contract[name] = {
+ "type": raw_spec["type"],
+ "default": raw_spec["default"],
+ "values": list(raw_spec["values"]),
+ }
+ return {
+ "input": effect,
+ "effect": canonical,
+ "name": NATIVE_TRANSITIONS[canonical]["name"],
+ "category": NATIVE_TRANSITIONS[canonical]["category"],
+ "compatibility_alias": (
+ effect
+ if isinstance(effect, str) and effect in TRANSITION_ALIASES
+ else None
+ ),
+ "implied_effect_options": implied_options,
+ "effect_options": option_contract,
+ "timing": {
+ "duration": "positive seconds",
+ "auto_advance": "non-negative seconds",
+ },
+ }
def _seconds_to_ms(value: object, field: str, *, allow_zero: bool) -> int:
@@ -515,18 +1129,52 @@ def _seconds_to_ms(value: object, field: str, *, allow_zero: bool) -> int:
return milliseconds if allow_zero else max(1, milliseconds)
-def _effect_spec(effect: str) -> tuple[str, str, str, dict[str, Any], str | None]:
- info = CANONICAL_TRANSITIONS[effect]
+def _effect_spec(
+ effect: str,
+ effect_options: object = None,
+) -> tuple[str, str, str, dict[str, Any], str | None]:
+ info = NATIVE_TRANSITIONS[effect]
prefix = str(info.get("prefix", "p"))
namespace = TRANSITION_NAMESPACES[prefix]
element = str(info["element"])
attrs = dict(info.get("attrs", {}))
fallback = info.get("fallback")
+ options = {
+ name: option_spec["default"]
+ for name, option_spec in info["effectOptions"].items()
+ }
+ options.update(
+ normalize_transition_effect_options(effect, effect_options)
+ )
+ option_specs = info["effectOptions"]
+ for name, value in options.items():
+ override = option_specs[name]["values"][value]
+ if "prefix" in override:
+ prefix = str(override["prefix"])
+ namespace = TRANSITION_NAMESPACES[prefix]
+ if "element" in override:
+ element = str(override["element"])
+ for attribute in override.get("remove_attrs", ()):
+ attrs.pop(str(attribute), None)
+ attrs.update(
+ {
+ str(attribute): str(attribute_value)
+ for attribute, attribute_value in override.get("attrs", {}).items()
+ }
+ )
+ if "fallback" in override:
+ fallback = override["fallback"]
return prefix, namespace, element, attrs, str(fallback) if fallback else None
-def _effect_xml(effect: str) -> tuple[str, str, str]:
- prefix, _namespace, element, effect_attrs, _fallback = _effect_spec(effect)
+def _effect_xml(
+ effect: str,
+ effect_options: object = None,
+) -> tuple[str, str, str]:
+ prefix, _namespace, element, effect_attrs, _fallback = _effect_spec(
+ effect,
+ effect_options,
+ )
attrs = " ".join(
f'{key}="{value}"'
for key, value in effect_attrs.items()
@@ -559,9 +1207,13 @@ def create_transition_xml(
duration: float = 0.5,
advance_after: float | None = None,
advance_on_click: bool | None = None,
+ effect_options: Mapping[str, object] | None = None,
) -> str:
"""Build a direct or MCE-backed p:transition XML fragment."""
- normalized_effect = normalize_transition_effect(effect)
+ normalized_effect, normalized_options = normalize_transition_effect_request(
+ effect,
+ effect_options,
+ )
duration_ms = None
if normalized_effect is not None:
duration_ms = _seconds_to_ms(
@@ -598,10 +1250,14 @@ def create_transition_xml(
if normalized_effect is None:
return f" <p:transition{attr_text}/>"
- prefix, element_name, effect_attrs = _effect_xml(normalized_effect)
+ prefix, element_name, effect_attrs = _effect_xml(
+ normalized_effect,
+ normalized_options,
+ )
if prefix != "p":
_effect_prefix, _namespace, _element, _attrs, fallback = _effect_spec(
- normalized_effect
+ normalized_effect,
+ normalized_options,
)
fallback_effect = fallback or "fade"
fallback_prefix, fallback_name, fallback_attrs = _effect_xml(
@@ -657,8 +1313,12 @@ def _build_transition_element(
duration: float,
advance_after: float | None,
advance_on_click: bool | None,
+ effect_options: Mapping[str, object] | None = None,
) -> Any | None:
- normalized_effect = normalize_transition_effect(effect)
+ normalized_effect, normalized_options = normalize_transition_effect_request(
+ effect,
+ effect_options,
+ )
if (
normalized_effect is None
and advance_after is None
@@ -694,6 +1354,7 @@ def _build_transition_element(
effect_name: str | None,
*,
include_duration: bool,
+ options: Mapping[str, object] | None = None,
) -> Any:
nsmap = {"p": PML_NS}
if include_duration:
@@ -711,7 +1372,7 @@ def _build_transition_element(
transition.set("advTm", str(advance_ms))
if effect_name is not None:
_prefix, namespace, element_name, effect_attrs, _fallback = (
- _effect_spec(effect_name)
+ _effect_spec(effect_name, options)
)
child = _new_element(context, _qn(namespace, element_name))
for key, value in effect_attrs.items():
@@ -723,10 +1384,15 @@ def _build_transition_element(
return build_transition(None, include_duration=False)
prefix, _namespace, _element, _attrs, fallback = _effect_spec(
- normalized_effect
+ normalized_effect,
+ normalized_options,
)
if prefix == "p":
- return build_transition(normalized_effect, include_duration=True)
+ return build_transition(
+ normalized_effect,
+ include_duration=True,
+ options=normalized_options,
+ )
carrier = _new_element(
context,
@@ -739,7 +1405,13 @@ def _build_transition_element(
nsmap={prefix: TRANSITION_NAMESPACES[prefix]},
)
choice.set("Requires", prefix)
- choice.append(build_transition(normalized_effect, include_duration=True))
+ choice.append(
+ build_transition(
+ normalized_effect,
+ include_duration=True,
+ options=normalized_options,
+ )
+ )
fallback_node = _new_element(context, _qn(MC_NS, "Fallback"))
fallback_node.append(
build_transition(fallback or "fade", include_duration=False)
@@ -792,14 +1464,67 @@ def _primary_and_fallback(carrier: Any) -> tuple[Any | None, Any | None]:
return primary, fallback
-def _effect_identity(transition: Any | None) -> tuple[str | None, str | None]:
+def _effect_identity(
+ transition: Any | None,
+) -> tuple[str | None, str | None, dict[str, str]]:
if transition is None:
- return None, None
+ return None, None, {}
for child in list(transition):
if child.tag == _qn(PML_NS, "sndAc"):
continue
- return _local_name(child.tag), _namespace_name(child.tag)
- return None, None
+ return (
+ _local_name(child.tag),
+ _namespace_name(child.tag),
+ {str(name): str(value) for name, value in child.attrib.items()},
+ )
+ return None, None, {}
+
+
+def _effective_transition_options(
+ effect: str,
+ options: Mapping[str, object] | None = None,
+) -> dict[str, object]:
+ effective = {
+ name: spec["default"]
+ for name, spec in NATIVE_TRANSITIONS[effect]["effectOptions"].items()
+ }
+ effective.update(normalize_transition_effect_options(effect, options))
+ return effective
+
+
+def _transition_option_combinations(effect: str) -> list[dict[str, object]]:
+ combinations: list[dict[str, object]] = [{}]
+ for name, spec in NATIVE_TRANSITIONS[effect]["effectOptions"].items():
+ combinations = [
+ {**combination, name: value}
+ for combination in combinations
+ for value in spec["values"]
+ ]
+ return combinations
+
+
+def _identify_native_transition(
+ element: str | None,
+ namespace: str | None,
+ attributes: Mapping[str, str],
+) -> tuple[str | None, dict[str, object]]:
+ if element is None or namespace is None:
+ return None, {}
+ for effect in NATIVE_TRANSITION_KEYS:
+ for options in _transition_option_combinations(effect):
+ _prefix, expected_namespace, expected_element, expected_attrs, _fallback = (
+ _effect_spec(effect, options)
+ )
+ if (
+ namespace == expected_namespace
+ and element == expected_element
+ and dict(attributes) == {
+ str(name): str(value)
+ for name, value in expected_attrs.items()
+ }
+ ):
+ return effect, options
+ return None, {}
def _int_attribute(element: Any | None, *names: str) -> int | None:
@@ -831,8 +1556,15 @@ def read_slide_transition(slide_root: Any) -> TransitionSummary:
carrier = carriers[0]
primary, fallback = _primary_and_fallback(carrier)
- effect, effect_namespace = _effect_identity(primary)
- fallback_effect, fallback_namespace = _effect_identity(fallback)
+ effect, effect_namespace, effect_attributes = _effect_identity(primary)
+ fallback_effect, fallback_namespace, _fallback_attributes = _effect_identity(
+ fallback
+ )
+ canonical_effect, effect_options = _identify_native_transition(
+ effect,
+ effect_namespace,
+ effect_attributes,
+ )
carrier_name = (
"alternate-content"
if carrier.tag == _qn(MC_NS, "AlternateContent")
@@ -849,6 +1581,9 @@ def read_slide_transition(slide_root: Any) -> TransitionSummary:
logical_count=len(carriers),
effect=effect,
effect_namespace=effect_namespace,
+ effect_attributes=effect_attributes,
+ canonical_effect=canonical_effect,
+ effect_options=effect_options,
fallback_effect=fallback_effect,
fallback_effect_namespace=fallback_namespace,
duration_ms=duration_ms,
@@ -964,6 +1699,13 @@ def _apply_slide_motion_unchecked(
f"unknown transition enter policy {enter.policy!r}; "
f"valid policies: {', '.join(sorted(valid_policies))}"
)
+ if (
+ enter.policy != "replace"
+ and enter.effect_options not in (None, {})
+ ):
+ raise ValueError(
+ "transition effect_options require enter policy 'replace'"
+ )
carriers = transition_carriers(slide_root)
if len(carriers) > 1:
@@ -1001,15 +1743,20 @@ def _apply_slide_motion_unchecked(
duration=enter.duration,
advance_after=advance_after,
advance_on_click=advance_on_click,
+ effect_options=None,
)
if transition is not None:
_insert_transition_carrier(slide_root, transition)
return advance_after is not None
- effect = (
- normalize_transition_effect(enter.effect, allow_none=False)
+ effect, effect_options = (
+ normalize_transition_effect_request(
+ enter.effect,
+ enter.effect_options,
+ allow_none=False,
+ )
if enter.policy == "replace"
- else None
+ else (None, {})
)
duration = validate_seconds(
enter.duration,
@@ -1026,6 +1773,7 @@ def _apply_slide_motion_unchecked(
duration=duration,
advance_after=advance_after,
advance_on_click=advance_on_click,
+ effect_options=effect_options,
)
if transition is not None:
_insert_transition_carrier(slide_root, transition)
@@ -1038,6 +1786,9 @@ def _visual_identity(summary: TransitionSummary) -> tuple[Any, ...]:
summary.logical_count,
summary.effect,
summary.effect_namespace,
+ tuple(sorted(summary.effect_attributes.items())),
+ summary.canonical_effect,
+ tuple(sorted(summary.effect_options.items())),
summary.fallback_effect,
summary.fallback_effect_namespace,
summary.duration_ms,
@@ -1047,8 +1798,12 @@ def _visual_identity(summary: TransitionSummary) -> tuple[Any, ...]:
def _expected_visual_identity(
effect: str,
+ effect_options: Mapping[str, object] | None = None,
) -> tuple[str, str, str, str | None, str | None, dict[str, Any]]:
- prefix, namespace, element, attrs, fallback = _effect_spec(effect)
+ prefix, namespace, element, attrs, fallback = _effect_spec(
+ effect,
+ effect_options,
+ )
carrier = "direct" if prefix == "p" else "alternate-content"
fallback_element = None
fallback_namespace = None
@@ -1086,7 +1841,15 @@ def _validate_applied_motion(
elif not before.logical_count and after.effect is not None:
errors.append("preserve policy added a visual transition")
elif enter.policy == "replace":
- effect = normalize_transition_effect(enter.effect, allow_none=False)
+ effect, effect_options = normalize_transition_effect_request(
+ enter.effect,
+ enter.effect_options,
+ allow_none=False,
+ )
+ expected_effect_options = _effective_transition_options(
+ effect,
+ effect_options,
+ )
expected_duration = _seconds_to_ms(
enter.duration,
"transition duration",
@@ -1099,12 +1862,14 @@ def _validate_applied_motion(
expected_fallback,
expected_fallback_namespace,
expected_attrs,
- ) = _expected_visual_identity(effect)
+ ) = _expected_visual_identity(effect, effect_options)
if (
after.carrier != expected_carrier
or after.logical_count != 1
or after.effect != expected_effect
or after.effect_namespace != expected_namespace
+ or after.canonical_effect != effect
+ or dict(after.effect_options) != expected_effect_options
or after.fallback_effect != expected_fallback
or after.fallback_effect_namespace != expected_fallback_namespace
or after.duration_ms != expected_duration
@@ -1402,13 +2167,17 @@ def validate_generated_transition_xml(
duration: object,
advance_on_click: bool | None,
advance_after: object | None,
+ effect_options: Mapping[str, object] | None = None,
) -> TransitionSummary:
"""Validate a generated transition against its resolved settings."""
data = slide_xml.encode("utf-8") if isinstance(slide_xml, str) else slide_xml
root = LET.fromstring(data) if LET is not None else parse_source_xml(data)
errors = validate_slide_transition_structure(root) + validate_mce_prefixes(data)
summary = read_slide_transition(root)
- normalized_effect = normalize_transition_effect(effect)
+ normalized_effect, normalized_options = normalize_transition_effect_request(
+ effect,
+ effect_options,
+ )
expected_click = True if advance_on_click is None else advance_on_click
if not isinstance(expected_click, bool):
errors.append("transition advance_on_click must be a boolean or None")
@@ -1454,12 +2223,23 @@ def validate_generated_transition_xml(
expected_fallback,
expected_fallback_namespace,
expected_attrs,
- ) = _expected_visual_identity(normalized_effect)
+ ) = _expected_visual_identity(
+ normalized_effect,
+ normalized_options,
+ )
+ expected_effect_options = _effective_transition_options(
+ normalized_effect,
+ normalized_options,
+ )
+ else:
+ expected_effect_options = {}
if (
summary.carrier != expected_carrier
or summary.logical_count != 1
or summary.effect != expected_effect
or summary.effect_namespace != expected_namespace
+ or summary.canonical_effect != normalized_effect
+ or dict(summary.effect_options) != expected_effect_options
or summary.fallback_effect != expected_fallback
or summary.fallback_effect_namespace != expected_fallback_namespace
or summary.duration_ms != expected_duration_ms
diff --git a/skills/ppt-master/scripts/svg_to_pptx/animation_config.py b/skills/ppt-master/scripts/svg_to_pptx/animation_config.py
index 60d78071..e829ad88 100644
--- a/skills/ppt-master/scripts/svg_to_pptx/animation_config.py
+++ b/skills/ppt-master/scripts/svg_to_pptx/animation_config.py
@@ -23,7 +23,11 @@ from pptx_animations import (
normalize_animation_effect_request,
normalize_animation_trigger,
)
-from pptx_transitions import TRANSITIONS, validate_seconds
+from pptx_transitions import (
+ normalize_transition_effect,
+ normalize_transition_effect_request,
+ validate_seconds,
+)
from .drawingml.utils import SVG_NS
from .semantic_markers import is_static_page_frame
@@ -184,7 +188,11 @@ def load_animation_config(project_path: Path, config_path: str | None = None) ->
def _valid_transition_effect(effect: str) -> bool:
- return effect == 'none' or effect in TRANSITIONS
+ try:
+ normalize_transition_effect(effect)
+ except ValueError:
+ return False
+ return True
def _animation_effect_error(effect: object, label: str) -> str | None:
@@ -435,20 +443,27 @@ def _transition_scope_errors(
errors = _unknown_field_errors(
transition,
- frozenset({'effect', 'duration', 'auto_advance'}),
+ frozenset({'effect', 'effect_options', 'duration', 'auto_advance'}),
f'{label} transition',
)
- if 'effect' in transition:
- effect = transition['effect']
- if not isinstance(effect, str):
- errors.append(
- f'animations.json {label} transition effect must be a string'
- )
- elif not _valid_transition_effect(effect):
- errors.append(
- f'animations.json {label} has unknown transition effect: {effect}'
- )
- duration_allows_zero = transition.get('effect', inherited_effect) == 'none'
+ effect = transition.get('effect', inherited_effect)
+ effect_options = transition.get('effect_options')
+ if effect_options is not None and 'effect' not in transition:
+ errors.append(
+ f'animations.json {label} transition effect_options requires '
+ 'an explicit effect'
+ )
+ else:
+ try:
+ normalize_transition_effect_request(effect, effect_options)
+ except ValueError as exc:
+ errors.append(f'animations.json {label} transition: {exc}')
+ try:
+ duration_allows_zero = (
+ normalize_transition_effect(effect) is None
+ )
+ except ValueError:
+ duration_allows_zero = False
for field, allow_zero in (
('duration', duration_allows_zero),
('auto_advance', True),
diff --git a/skills/ppt-master/scripts/svg_to_pptx/pptx_package/builder.py b/skills/ppt-master/scripts/svg_to_pptx/pptx_package/builder.py
index 0a31c0ad..66b7f296 100644
--- a/skills/ppt-master/scripts/svg_to_pptx/pptx_package/builder.py
+++ b/skills/ppt-master/scripts/svg_to_pptx/pptx_package/builder.py
@@ -29,9 +29,9 @@ from pptx import Presentation
from pptx.util import Emu
from pptx_transitions import (
- TRANSITIONS,
+ NATIVE_TRANSITIONS,
create_transition_xml,
- normalize_transition_effect,
+ normalize_transition_effect_request,
set_directory_use_timings,
validate_generated_transition_xml,
validate_pptx_transition_package,
@@ -3909,21 +3909,32 @@ def _slide_config(animation_config: dict[str, Any] | None, svg_stem: str) -> dic
def _slide_transition_settings(
slide_cfg: dict[str, Any],
transition: str | None,
+ transition_effect_options: dict[str, object] | None,
duration: float,
auto_advance: float | None,
cli_overrides: dict[str, bool],
-) -> tuple[str | None, float, float | None]:
+) -> tuple[str | None, dict[str, object], float, float | None]:
trans_value = slide_cfg.get('transition', {})
if not isinstance(trans_value, dict):
raise ValueError('animations.json slide transition must be an object')
trans_cfg = trans_value
- effect = transition
- if not cli_overrides.get('transition') and 'effect' in trans_cfg:
- raw_effect = trans_cfg['effect']
- if not isinstance(raw_effect, str):
- raise ValueError('animations.json transition effect must be a string')
- cfg_effect = normalize_transition_effect(raw_effect)
- effect = cfg_effect
+ effect, effect_options = normalize_transition_effect_request(
+ transition,
+ transition_effect_options,
+ )
+ if not cli_overrides.get('transition'):
+ if 'effect' in trans_cfg:
+ raw_effect = trans_cfg['effect']
+ raw_options = trans_cfg.get('effect_options')
+ effect, effect_options = normalize_transition_effect_request(
+ raw_effect,
+ raw_options,
+ )
+ elif 'effect_options' in trans_cfg:
+ raise ValueError(
+ 'animations.json transition effect_options requires '
+ 'an explicit effect'
+ )
if not cli_overrides.get('transition_duration'):
if 'duration' in trans_cfg:
duration = validate_seconds(
@@ -3937,7 +3948,7 @@ def _slide_transition_settings(
"transition auto_advance",
allow_zero=True,
)
- return effect, duration, auto_advance
+ return effect, effect_options, duration, auto_advance
def _slide_animation_settings(
@@ -4651,6 +4662,7 @@ def create_pptx_with_native_svg(
layout_definition_files: list[Path] | None = None,
expected_viewbox: str | None = None,
animation_resource_root: Path | None = None,
+ transition_effect_options: dict[str, object] | None = None,
) -> bool:
"""Create a PPTX file with native DrawingML shapes.
@@ -4667,6 +4679,8 @@ def create_pptx_with_native_svg(
paths. Defaults to the parent of the SVG source directory.
verbose: Whether to output detailed information.
transition: Transition effect name.
+ transition_effect_options: PowerPoint Effect Options for the selected
+ native page transition.
transition_duration: Transition duration in seconds.
auto_advance: Auto-advance interval in seconds.
use_compat_mode: Retained for API compatibility; ignored in native mode.
@@ -4892,7 +4906,20 @@ def create_pptx_with_native_svg(
else:
print(f" Compatibility mode: Disabled (pure SVG)")
if transition:
- trans_name = TRANSITIONS.get(transition, {}).get('name', transition) if TRANSITIONS else transition
+ canonical_transition, _transition_options = (
+ normalize_transition_effect_request(
+ transition,
+ transition_effect_options,
+ )
+ )
+ trans_name = (
+ NATIVE_TRANSITIONS.get(canonical_transition, {}).get(
+ 'name',
+ canonical_transition,
+ )
+ if canonical_transition
+ else transition
+ )
print(f" Transition effect: {trans_name}")
if enable_notes and notes:
print(f" Speaker notes: {len(notes)} page(s)")
@@ -5035,6 +5062,7 @@ def create_pptx_with_native_svg(
)
if is_layout_definition:
slide_transition = None
+ slide_transition_effect_options = {}
slide_transition_duration = transition_duration
slide_auto_advance = None
slide_animation = None
@@ -5045,11 +5073,13 @@ def create_pptx_with_native_svg(
else:
(
slide_transition,
+ slide_transition_effect_options,
slide_transition_duration,
slide_auto_advance,
) = _slide_transition_settings(
slide_cfg,
transition,
+ transition_effect_options,
transition_duration,
auto_advance,
animation_cli_overrides,
@@ -5133,6 +5163,7 @@ def create_pptx_with_native_svg(
effect=slide_transition,
duration=slide_transition_duration,
advance_after=slide_auto_advance,
+ effect_options=slide_transition_effect_options,
)
if transition_fragment:
slide_xml = slide_xml.replace(
@@ -5273,10 +5304,16 @@ def create_pptx_with_native_svg(
# ---- Legacy SVG embedding mode ----
else:
slide_cfg = _slide_config(animation_config, svg_path.stem)
- slide_transition, slide_transition_duration, slide_auto_advance = (
+ (
+ slide_transition,
+ slide_transition_effect_options,
+ slide_transition_duration,
+ slide_auto_advance,
+ ) = (
_slide_transition_settings(
slide_cfg,
transition,
+ transition_effect_options,
transition_duration,
auto_advance,
animation_cli_overrides,
@@ -5317,6 +5354,7 @@ def create_pptx_with_native_svg(
png_rid=png_rid, svg_rid=svg_rid,
width_emu=width_emu, height_emu=height_emu,
transition=slide_transition,
+ transition_effect_options=slide_transition_effect_options,
transition_duration=slide_transition_duration,
auto_advance=slide_auto_advance,
use_compat_mode=(use_compat_mode and slide_has_png),
@@ -5443,6 +5481,7 @@ def create_pptx_with_native_svg(
resolved_motion = validate_generated_transition_xml(
final_slide_xml,
effect=slide_transition,
+ effect_options=slide_transition_effect_options,
duration=slide_transition_duration,
advance_on_click=resolved_advance_on_click,
advance_after=resolved_advance_after,
diff --git a/skills/ppt-master/scripts/svg_to_pptx/pptx_package/cli.py b/skills/ppt-master/scripts/svg_to_pptx/pptx_package/cli.py
index 3808d9b5..0a276c91 100644
--- a/skills/ppt-master/scripts/svg_to_pptx/pptx_package/cli.py
+++ b/skills/ppt-master/scripts/svg_to_pptx/pptx_package/cli.py
@@ -27,7 +27,12 @@ from pptx_animations import ( # noqa: E402
normalize_animation_effect,
normalize_animation_trigger,
)
-from pptx_transitions import validate_seconds # noqa: E402
+from pptx_transitions import ( # noqa: E402
+ LEGACY_TRANSITION_KEYS,
+ NATIVE_TRANSITION_KEYS,
+ normalize_transition_effect_request,
+ validate_seconds,
+)
configure_utf8_stdio()
@@ -55,7 +60,6 @@ from ..drawingml.theme_fonts import (
load_theme_font_spec,
)
from .narration import NARRATION_EXTENSIONS, find_narration_files, probe_audio_duration
-from .slide_xml import TRANSITIONS
from .template_structure import (
TemplateStructureError,
load_pptx_structure_lock,
@@ -647,7 +651,11 @@ def _recorded_narration_on_click_slides(
def main(argv: list[str] | None = None) -> int:
"""CLI entry point for the SVG to PPTX conversion tool."""
- transition_choices = ['none', *TRANSITIONS]
+ transition_choices = [
+ 'none',
+ *NATIVE_TRANSITION_KEYS,
+ *LEGACY_TRANSITION_KEYS,
+ ]
animation_choices = ['none', *ANIMATIONS, 'auto', 'mixed', 'random']
@@ -670,7 +678,10 @@ SVG source directory (-s):
Omit -s to use the default: native export reads svg_output.
Transition effects (-t/--transition):
- {', '.join(transition_choices)}
+ New selections use the 48 PowerPoint-native gallery keys. The 8 old
+ names remain accepted only as compatibility inputs. Run
+ scripts/pptx_animations.py --list for the categorized registry and
+ --describe-transition <effect> for its Effect Options.
Per-element object animation (-a/--animation, native shapes mode):
Use PowerPoint-native entrance_*, emphasis_*, path_*, and exit_* keys for
@@ -1306,8 +1317,17 @@ Recorded narration:
else transition_defaults.get('effect', 'fade')
)
)
- transition = None if transition_effect == 'none' else transition_effect
try:
+ transition, transition_effect_options = (
+ normalize_transition_effect_request(
+ transition_effect,
+ (
+ None
+ if transition_arg is not None or args.no_animations
+ else transition_defaults.get('effect_options')
+ ),
+ )
+ )
transition_duration = validate_seconds(
(
args.transition_duration
@@ -1451,6 +1471,7 @@ Recorded narration:
structure_name=structure_name,
verbose=verbose,
transition=transition,
+ transition_effect_options=transition_effect_options,
transition_duration=transition_duration,
auto_advance=auto_advance,
notes=notes,
diff --git a/skills/ppt-master/scripts/svg_to_pptx/pptx_package/slide_xml.py b/skills/ppt-master/scripts/svg_to_pptx/pptx_package/slide_xml.py
index 0c541f1c..f9ec9e63 100644
--- a/skills/ppt-master/scripts/svg_to_pptx/pptx_package/slide_xml.py
+++ b/skills/ppt-master/scripts/svg_to_pptx/pptx_package/slide_xml.py
@@ -2,7 +2,7 @@
from __future__ import annotations
-from pptx_transitions import TRANSITIONS, create_transition_xml
+from pptx_transitions import create_transition_xml
def create_slide_xml_with_svg(
@@ -15,6 +15,7 @@ def create_slide_xml_with_svg(
transition_duration: float = 0.5,
auto_advance: float | None = None,
use_compat_mode: bool = True,
+ transition_effect_options: dict[str, object] | None = None,
) -> str:
"""Create slide XML containing an SVG image.
@@ -25,6 +26,8 @@ def create_slide_xml_with_svg(
width_emu: Width in EMU.
height_emu: Height in EMU.
transition: Transition effect name.
+ transition_effect_options: PowerPoint Effect Options for the selected
+ native transition.
transition_duration: Transition duration in seconds.
auto_advance: Auto-advance interval in seconds.
use_compat_mode: Whether to use compatibility mode (PNG + SVG dual format).
@@ -35,6 +38,7 @@ def create_slide_xml_with_svg(
effect=transition,
duration=transition_duration,
advance_after=auto_advance,
+ effect_options=transition_effect_options,
)
if transition_fragment:
transition_xml = '\n' + transition_fragment
diff --git a/skills/ppt-master/scripts/template_fill_pptx/applier.py b/skills/ppt-master/scripts/template_fill_pptx/applier.py
index e6a4f1b9..7285f506 100644
--- a/skills/ppt-master/scripts/template_fill_pptx/applier.py
+++ b/skills/ppt-master/scripts/template_fill_pptx/applier.py
@@ -121,7 +121,12 @@ def apply_plan(
source_slide=source_slide,
table_edits=table_edits,
)
- slide_effect, slide_duration, slide_advance = _resolve_slide_transition(
+ (
+ slide_effect,
+ slide_effect_options,
+ slide_duration,
+ slide_advance,
+ ) = _resolve_slide_transition(
item,
default_effect=transition,
default_duration=transition_duration,
@@ -129,6 +134,7 @@ def apply_plan(
slide_has_auto_advance = _set_slide_transition(
slide_root,
effect=slide_effect,
+ effect_options=slide_effect_options,
duration=slide_duration,
advance_after=slide_advance,
)
diff --git a/skills/ppt-master/scripts/template_fill_pptx/cli.py b/skills/ppt-master/scripts/template_fill_pptx/cli.py
index 885d1e93..d2125d34 100644
--- a/skills/ppt-master/scripts/template_fill_pptx/cli.py
+++ b/skills/ppt-master/scripts/template_fill_pptx/cli.py
@@ -13,6 +13,10 @@ if str(_SCRIPTS_DIR) not in sys.path:
sys.path.insert(0, str(_SCRIPTS_DIR))
from console_encoding import configure_utf8_stdio # noqa: E402
+from pptx_transitions import ( # noqa: E402
+ LEGACY_TRANSITION_KEYS,
+ NATIVE_TRANSITION_KEYS,
+)
configure_utf8_stdio()
@@ -39,7 +43,6 @@ from .transitions import (
DEFAULT_TRANSITION,
DEFAULT_TRANSITION_DURATION,
KEEP_TRANSITION,
- TRANSITIONS,
)
from .validator import print_validate_report, validate_project
@@ -116,11 +119,17 @@ def build_parser() -> argparse.ArgumentParser:
)
apply.add_argument(
"--transition",
- choices=sorted(TRANSITIONS) + ["none", KEEP_TRANSITION],
+ choices=[
+ *NATIVE_TRANSITION_KEYS,
+ *LEGACY_TRANSITION_KEYS,
+ "none",
+ KEEP_TRANSITION,
+ ],
default=DEFAULT_TRANSITION,
help=(
"Page-to-page transition applied to every cloned slide "
"(per-slide 'transition' in the plan overrides this). "
+ "Use a PowerPoint-native key; old names are compatibility inputs. "
f"Default: {DEFAULT_TRANSITION}. Use 'none' for no motion, "
"or 'keep' to preserve each source slide's existing transition."
),
diff --git a/skills/ppt-master/scripts/template_fill_pptx/transitions.py b/skills/ppt-master/scripts/template_fill_pptx/transitions.py
index 868bd463..3ba86623 100644
--- a/skills/ppt-master/scripts/template_fill_pptx/transitions.py
+++ b/skills/ppt-master/scripts/template_fill_pptx/transitions.py
@@ -12,10 +12,10 @@ from typing import Any
from xml.etree import ElementTree as ET
from pptx_transitions import (
- TRANSITIONS,
AdvanceUpdate,
EnterUpdate,
apply_slide_motion,
+ normalize_transition_effect_request,
validate_seconds,
)
@@ -34,6 +34,7 @@ def _set_slide_transition(
*,
effect: str | None,
duration: float,
+ effect_options: dict[str, object] | None = None,
advance_after: float | None = None,
) -> bool:
"""Apply a legacy template-fill transition through the shared core.
@@ -61,6 +62,7 @@ def _set_slide_transition(
policy="replace",
effect=effect,
duration=duration,
+ effect_options=effect_options,
)
advance = AdvanceUpdate(
mode="click" if advance_after is None else "both",
@@ -82,22 +84,44 @@ def _resolve_slide_transition(
*,
default_effect: str | None,
default_duration: float,
-) -> tuple[str | None, float, float | None]:
+) -> tuple[str | None, dict[str, object], float, float | None]:
"""Pick a slide's transition from its plan entry, falling back to CLI defaults."""
raw = item.get("transition", _UNSET)
if raw is _UNSET:
- return default_effect, default_duration, None
+ if default_effect in (None, "none", KEEP_TRANSITION):
+ return default_effect, {}, default_duration, None
+ effect, effect_options = normalize_transition_effect_request(
+ default_effect,
+ allow_none=False,
+ )
+ return effect, effect_options, default_duration, None
if isinstance(raw, dict):
effect = raw.get("effect", default_effect)
+ raw_options = raw.get("effect_options")
+ if raw_options is not None and "effect" not in raw:
+ raise RuntimeError(
+ "Transition effect_options requires an explicit effect"
+ )
duration = raw.get("duration", default_duration)
advance_after = raw.get("advance_after")
else:
effect = None if raw is None else str(raw)
+ raw_options = None
duration = default_duration
advance_after = None
- if effect is not None and effect not in ("none", KEEP_TRANSITION) and effect not in TRANSITIONS:
+ effect_options: dict[str, object] = {}
+ if effect is not None and effect not in ("none", KEEP_TRANSITION):
+ try:
+ effect, effect_options = normalize_transition_effect_request(
+ effect,
+ raw_options,
+ allow_none=False,
+ )
+ except ValueError as exc:
+ raise RuntimeError(str(exc)) from exc
+ elif raw_options not in (None, {}):
raise RuntimeError(
- f"Unknown transition effect '{effect}'. Valid: {', '.join(sorted(TRANSITIONS))}, none, {KEEP_TRANSITION}"
+ "Transition effect_options requires an explicit native effect"
)
try:
resolved_duration = validate_seconds(
@@ -107,4 +131,4 @@ def _resolve_slide_transition(
)
except ValueError as exc:
raise RuntimeError(str(exc)) from exc
- return effect, resolved_duration, advance_after
+ return effect, effect_options, resolved_duration, advance_after
diff --git a/skills/ppt-master/workflows/native-enhance-pptx.md b/skills/ppt-master/workflows/native-enhance-pptx.md
index b1f776ab..8071cfc4 100644
--- a/skills/ppt-master/workflows/native-enhance-pptx.md
+++ b/skills/ppt-master/workflows/native-enhance-pptx.md
@@ -130,7 +130,7 @@ Present the plan to the user before generating notes or audio:
| `notes` | Enabled | Add/replace speaker notes generated from slide content? |
| `audio` | Enabled when user wants narration/video/autoplay | Generate one narration audio file per slide? |
| `timings` | Enabled with audio | Set slide auto-advance from audio duration? |
-| `transitions` | Enabled, `fade` 0.5s | Add page transitions? Which effect/duration? |
+| `transitions` | Enabled, `fade` 0.5s | Add page transitions? Which canonical native effect, Effect Options, and duration? |
**⛔ BLOCKING**: Stop here and wait for explicit user confirmation. Do not generate notes, generate audio, or patch the PPTX until the user confirms the module plan.
@@ -144,7 +144,13 @@ Present the plan to the user before generating notes or audio:
| Timings enabled with audio | Keep the resolved enter policy | Use audio duration plus narration padding; click disabled |
| Timings disabled | Apply the confirmed enter policy only | Do not run `ffprobe`; do not add/change `advTm` or `useTimings` |
-**Hard rule — no silent downgrade**: a requested supported effect must be written with its established direction/variant attributes. Unknown requested effects fail; unknown source effects are preserved when the transition module is disabled.
+The confirmed `modules.transitions` object may include `effect_options` beside
+an explicit canonical `effect`. Use
+`pptx_animations.py --describe-transition <effect>` for its exact fields.
+Old names remain accepted only when reading compatibility input; a newly
+written plan stores the canonical effect and any implied options.
+
+**Hard rule — no silent downgrade**: a requested native effect must be written with its complete validated Effect Options. Unknown effects or inapplicable options fail; unknown source effects are preserved when the transition module is disabled.
After confirmation, update `<project>/analysis/enhancement_plan.json`:
diff --git a/skills/ppt-master/workflows/stages/customize-animations.md b/skills/ppt-master/workflows/stages/customize-animations.md
index a5e2f17e..b07828da 100644
--- a/skills/ppt-master/workflows/stages/customize-animations.md
+++ b/skills/ppt-master/workflows/stages/customize-animations.md
@@ -164,21 +164,28 @@ special motion; variation follows a real content/tone change, never a quota.
### 3.1 Supported Page Transitions
-Use any effect from the complete shared registry in
+Use one of the 48 canonical native effects from the complete shared registry in
[`animations.md`](../../references/animations.md) §3. It covers all current
-PowerPoint Subtle, Exciting, and Dynamic Content gallery effects, plus retained
-compatibility aliases. The aliases normalize to current gallery effects before
-writing. Use the documented identifier exactly; `none` removes the visual page
-transition while allowing timed advance to remain.
+PowerPoint Subtle, Exciting, and Dynamic Content gallery effects. The eight old
+names are readable only as compatibility inputs; do not write them in new
+plans or sidecars. They normalize to a canonical effect plus native
+`effect_options` before writing. `none` removes the visual page transition
+while allowing timed advance to remain.
**Transition fields**:
| Field | Behavior |
|---|---|
| `effect` | One supported page transition effect; `none` removes only the visual effect |
+| `effect_options` | Optional object containing only the selected native effect's PowerPoint Effect Options; requires an explicit `effect` |
| `duration` | Finite transition duration in seconds; must be greater than zero |
| `auto_advance` | Optional finite non-negative seconds before automatic slide advance; click remains enabled, and this field is valid with `effect: none` |
+Run
+`python3 skills/ppt-master/scripts/pptx_animations.py --describe-transition <effect>`
+before authoring Effect Options. Never infer that one effect accepts another
+effect's direction, shape, pattern, or boolean fields.
+
### 3.2 Supported In-Slide Animations
Use the 203 canonical PowerPoint-native keys: 53 `entrance_*`, 33
@@ -249,6 +256,7 @@ the deck-wide values copied into every complete new slide block.
| Field | Behavior |
|---|---|
| `transition.effect` | Slide-specific page transition effect |
+| `transition.effect_options` | Effect-specific native PowerPoint options; requires an explicit slide-specific `transition.effect` |
| `transition.duration` | Slide-specific page transition duration |
| `animation.effect` | Slide-specific default object animation effect |
| `animation.duration` | Slide-specific default object schedule duration |
@@ -291,7 +299,11 @@ groups appear only when they diverge**:
"animation": { "effect": "entrance_fade", "duration": 0.5, "stagger": 0.4, "trigger": "after-previous" }
},
"03_market": {
- "transition": { "effect": "wipe", "duration": 0.35 },
+ "transition": {
+ "effect": "wipe",
+ "effect_options": { "direction": "left" },
+ "duration": 0.35
+ },
"animation": { "effect": "entrance_fade", "duration": 0.4, "stagger": 0.25, "trigger": "after-previous" },
"groups": {
"chart": { "effect": "entrance_wipe", "effect_options": { "direction": "left" }, "order": 2, "duration": 0.6 },
diff --git a/skills/ppt-master/workflows/template-fill-pptx.md b/skills/ppt-master/workflows/template-fill-pptx.md
index 883cbb4f..a33c22ec 100644
--- a/skills/ppt-master/workflows/template-fill-pptx.md
+++ b/skills/ppt-master/workflows/template-fill-pptx.md
@@ -196,7 +196,7 @@ The plan structure:
| `layout_rationale` | Human review aid for page selection. Include `layout_pattern`, `why_fit`, and `risk`; it is not a mechanical checker gate. |
| `accepted_warnings` | Optional audit trail for warnings the user or agent explicitly accepts. `check-plan` warnings remain non-blocking; errors must be fixed. |
| `notes` | Optional spoken speaker notes for the filled slide — see **Speaker notes** below; write prose, not a copy of the on-slide text |
-| `transition` | Optional per-slide page transition; overrides the `apply --transition` default. Accepts any gallery effect or compatibility alias from [`animations.md`](../references/animations.md) §3, `none` to remove the visual effect, `keep` to preserve the source, or an object such as `{ "effect": "push", "duration": 0.6, "advance_after": 5 }` |
+| `transition` | Optional per-slide page transition; overrides the `apply --transition` default. New plans use one canonical native gallery effect from [`animations.md`](../references/animations.md) §3; old names remain read-compatible. Accepts `none` to remove the visual effect, `keep` to preserve the source, or an object such as `{ "effect": "push", "effect_options": { "direction": "left" }, "duration": 0.6, "advance_after": 5 }` |
| `replacements` | Target by `slot_id` whenever possible; `shape_id` and `shape_name` are fallback selectors |
| `table_edits` | Optional native table cell edits; target by `table_id` whenever possible and use zero-based `row` / `col` |
| `chart_edits` | Optional native chart data edits; target by `chart_id`, set `categories`, and provide one or more `series` |
@@ -272,7 +272,7 @@ Run:
python3 skills/ppt-master/scripts/template_fill_pptx.py apply "<project_dir>/sources/<source.pptx>" "<project_dir>/analysis/fill_plan.json" -o "<project_dir>/exports/<output.pptx>"
```
-By default `apply` gives every cloned slide a `fade` transition (`0.5s`), preserving the v1 route contract. Override it with `--transition <effect>` using any gallery effect or compatibility alias from [`animations.md`](../references/animations.md) §3 and `--transition-duration <seconds>`; pass `--transition none` for no visual motion, or `--transition keep` to preserve each source slide's existing transition unchanged. A per-slide `transition` field overrides the CLI. `advance_after` keeps click advance enabled and adds timed advance; it also works with `none` (timing-only transition) and `keep` (source effect preserved, Choice/Fallback timing updated together).
+By default `apply` gives every cloned slide a `fade` transition (`0.5s`), preserving the v1 route contract. Override it with `--transition <effect>` using a canonical gallery effect from [`animations.md`](../references/animations.md) §3 and `--transition-duration <seconds>`; old names remain accepted only as compatibility CLI inputs. Pass `--transition none` for no visual motion, or `--transition keep` to preserve each source slide's existing transition unchanged. A per-slide `transition` field overrides the CLI and may include native `effect_options`; these require an explicit effect and are validated effect-by-effect. `advance_after` keeps click advance enabled and adds timed advance; it also works with `none` (timing-only transition) and `keep` (source effect preserved, Choice/Fallback timing updated together).
`apply` appends a timestamp automatically. For example, `-o "<project_dir>/exports/demo.pptx"` writes `demo_YYYYMMDD_HHMMSS.pptx`. If the filename already ends with `_YYYYMMDD_HHMMSS`, it is left unchanged.