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(animation_config): slim scaffold + list-groups subcommand

hugohe3455f70262490
diff --git a/skills/ppt-master/scripts/animation_config.py b/skills/ppt-master/scripts/animation_config.py
index 49e70a08..9dd0ab22 100644
--- a/skills/ppt-master/scripts/animation_config.py
+++ b/skills/ppt-master/scripts/animation_config.py
@@ -6,10 +6,12 @@ Create and validate optional per-object PPTX animation sidecar files.
Usage:
python3 scripts/animation_config.py scaffold <project_path>
+ python3 scripts/animation_config.py list-groups <project_path>
python3 scripts/animation_config.py validate <project_path>
Examples:
python3 scripts/animation_config.py scaffold projects/demo --force
+ python3 scripts/animation_config.py list-groups projects/demo
python3 scripts/animation_config.py validate projects/demo
Dependencies:
@@ -27,6 +29,7 @@ if str(_SCRIPTS_DIR) not in sys.path:
sys.path.insert(0, str(_SCRIPTS_DIR))
from svg_to_pptx.animation_config import ( # noqa: E402
+ build_group_listing,
load_animation_config,
validate_animation_config,
write_scaffold,
@@ -48,6 +51,14 @@ def build_parser() -> argparse.ArgumentParser:
scaffold.add_argument('-o', '--output', default=None, help='Output path; default: <project>/animations.json')
scaffold.add_argument('--force', action='store_true', help='Overwrite an existing output file')
+ list_groups = subparsers.add_parser(
+ 'list-groups',
+ help='print one compact line per slide listing animatable group ids '
+ '(chrome groups excluded); use during planning to avoid reading '
+ 'the full scaffold file',
+ )
+ list_groups.add_argument('project_path', help='Project directory')
+
validate = subparsers.add_parser(
'validate',
help='validate animations.json references against svg_output/*.svg',
@@ -80,6 +91,14 @@ def main(argv: list[str] | None = None) -> int:
print(f'Animation config scaffold written: {output_path}')
return 0
+ if args.command == 'list-groups':
+ lines, anonymous = build_group_listing(project_path)
+ for line in lines:
+ print(line)
+ for warning in anonymous:
+ print(f'Warning: {warning}', file=sys.stderr)
+ return 0
+
if args.command == 'validate':
try:
config = load_animation_config(project_path, args.config)
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 1361f70b..625e864c 100644
--- a/skills/ppt-master/scripts/svg_to_pptx/animation_config.py
+++ b/skills/ppt-master/scripts/svg_to_pptx/animation_config.py
@@ -202,18 +202,53 @@ def _validate_scope_effects(scope: dict[str, Any], label: str, warnings: list[st
def build_scaffold(project_path: Path) -> dict[str, Any]:
- """Build an editable animation override scaffold from current SVGs."""
+ """Build an editable animation override scaffold from current SVGs.
+
+ Chrome groups are omitted — exporter auto-detects them as ``none`` via
+ ``is_chrome_id`` at render time, so listing them in the scaffold is pure
+ noise. A ``defaults`` stub is emitted up front to remind the editor that
+ deck-wide overrides exist and most pages should inherit them.
+ """
targets_by_slide, _anonymous = scan_project_targets(project_path)
slides: dict[str, Any] = {}
for slide_name, targets in targets_by_slide.items():
groups: dict[str, Any] = {}
for target in targets:
if target.chrome:
- groups[target.group_id] = {'effect': 'none'}
- else:
- groups[target.group_id] = {}
+ continue
+ groups[target.group_id] = {}
slides[slide_name] = {'groups': groups}
- return {'version': 1, 'slides': slides}
+ return {
+ 'version': 1,
+ 'defaults': {
+ 'transition': {'effect': 'fade', 'duration': 0.4},
+ 'animation': {
+ 'effect': 'auto',
+ 'duration': 0.5,
+ 'stagger': 0.2,
+ 'trigger': 'after-previous',
+ },
+ },
+ 'slides': slides,
+ }
+
+
+def build_group_listing(project_path: Path) -> tuple[list[str], list[str]]:
+ """Return one compact line per slide: ``<slide>: id1, id2, id3``.
+
+ Chrome groups are excluded — matches ``build_scaffold``'s policy so the
+ listing reflects exactly what an editor can override. Returns
+ ``(lines, anonymous_warnings)``.
+ """
+ targets_by_slide, anonymous = scan_project_targets(project_path)
+ lines: list[str] = []
+ for slide_name, targets in targets_by_slide.items():
+ ids = [t.group_id for t in targets if not t.chrome]
+ if not ids:
+ lines.append(f'{slide_name}: (no animatable groups)')
+ else:
+ lines.append(f'{slide_name}: {", ".join(ids)}')
+ return lines, anonymous
def write_scaffold(