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: default fade transition, fix reveal naming, use precise dur attribute
hugohe386f0a2f486cd
diff --git a/README.md b/README.mdindex f5d3afee..b230609f 100644--- a/README.md+++ b/README.md@@ -239,6 +239,7 @@ python3 skills/ppt-master/scripts/svg_to_pptx.py <project_path> -s final# Default: generates two files — native shapes (.pptx) + SVG reference (_svg.pptx)# Use --only native to skip SVG reference version# Use --only legacy to only generate SVG image version+# Default transition: fade (0.5s). Disable with: -t none```> 📖 For complete tool documentation, see [Tools Usage Guide](./skills/ppt-master/scripts/README.md)diff --git a/README_CN.md b/README_CN.mdindex 15524805..62c78225 100644--- a/README_CN.md+++ b/README_CN.md@@ -234,6 +234,7 @@ python3 skills/ppt-master/scripts/finalize_svg.py <项目路径>python3 skills/ppt-master/scripts/svg_to_pptx.py <项目路径> -s final# 默认生成两个文件:原生可编辑形状 (.pptx) + SVG 图片参考版 (_svg.pptx)# 仅生成原生版:--only native 仅生成 SVG 图片版:--only legacy+# 默认自带 fade 切换效果(0.5s),禁用切换:-t none```diff --git a/skills/ppt-master/scripts/README.md b/skills/ppt-master/scripts/README.mdindex 23329043..24a8e0b2 100644--- a/skills/ppt-master/scripts/README.md+++ b/skills/ppt-master/scripts/README.md@@ -600,8 +600,11 @@ python3 scripts/svg_to_pptx.py <project_path> -s final -o output.pptx# Disable speaker notespython3 scripts/svg_to_pptx.py <project_path> -s final --no-notes-# Add slide transition effects-python3 scripts/svg_to_pptx.py <project_path> -t fade --transition-duration 1.0+# Disable default fade transition+python3 scripts/svg_to_pptx.py <project_path> -t none++# Use a different transition effect+python3 scripts/svg_to_pptx.py <project_path> -t push --transition-duration 1.0# Silent modepython3 scripts/svg_to_pptx.py <project_path> -s final -q@@ -624,19 +627,20 @@ The tool automatically reads Markdown note files from the `notes/` directory and| Parameter | Description | Options ||-----------|-------------|---------|-| `-t`, `--transition` | Slide transition effect | fade, push, wipe, split, reveal, cover, random |-| `--transition-duration` | Transition duration in seconds (default 0.5) | Any positive number |+| `-t`, `--transition` | Slide transition effect (default: fade) | none, fade, push, wipe, split, strips, cover, random |+| `--transition-duration` | Transition duration in seconds (default: 0.5) | Any positive number || `--auto-advance` | Auto-advance interval in seconds | Any positive number |**Transition Effects**:| Effect | Description ||--------|-------------|-| fade | Fade in/out |+| none | No transition |+| fade | Fade in/out (default) || push | Push || wipe | Wipe || split | Split |-| reveal | Reveal |+| strips | Strips (diagonal wipe) || cover | Cover || random | Random |@@ -651,12 +655,12 @@ The tool automatically reads Markdown note files from the `notes/` directory and**Examples**:```bash-# Recommended workflow: post-process first, then export (with transition effects)+# Recommended workflow: post-process first, then export (fade transition applied by default)python3 scripts/finalize_svg.py examples/ppt169_demo-python3 scripts/svg_to_pptx.py examples/ppt169_demo -s final -t fade+python3 scripts/svg_to_pptx.py examples/ppt169_demo -s final-# Auto-play presentation (3-second transitions)-python3 scripts/svg_to_pptx.py examples/ppt169_demo -s final -t fade --auto-advance 3+# Auto-play presentation (3-second auto-advance)+python3 scripts/svg_to_pptx.py examples/ppt169_demo -s final --auto-advance 3```**Dependencies**:diff --git a/skills/ppt-master/scripts/pptx_animations.py b/skills/ppt-master/scripts/pptx_animations.pyindex 6377d501..9b3c95be 100644--- a/skills/ppt-master/scripts/pptx_animations.py+++ b/skills/ppt-master/scripts/pptx_animations.py@@ -9,7 +9,8 @@ Supported transition effects:- push: Push- wipe: Wipe- split: Split- - reveal: Reveal+ - strips: Strips (diagonal wipe)+ - cover: Cover- random: RandomSupported entrance animations:@@ -49,10 +50,10 @@ TRANSITIONS: Dict[str, Dict[str, Any]] = {'element': 'split','attrs': {'orient': 'horz', 'dir': 'out'},},- 'reveal': {- 'name': 'Reveal',+ 'strips': {+ 'name': 'Strips','element': 'strips',- 'attrs': {'dir': 'rd'}, # Reveal from bottom-right+ 'attrs': {'dir': 'rd'}, # Diagonal wipe from bottom-right},'cover': {'name': 'Cover',@@ -66,24 +67,6 @@ TRANSITIONS: Dict[str, Dict[str, Any]] = {},}-# Speed mapping (seconds -> OOXML speed values)-SPEED_MAP = {- 'slow': 1.0,- 'med': 0.5,- 'fast': 0.25,-}---def duration_to_speed(duration: float) -> str:- """Convert duration (seconds) to an OOXML speed value"""- if duration >= 0.75:- return 'slow'- elif duration >= 0.35:- return 'med'- else:- return 'fast'--def create_transition_xml(effect: str = 'fade',duration: float = 0.5,@@ -93,8 +76,8 @@ def create_transition_xml(Generate a slide transition effect XML fragmentArgs:- effect: Transition effect name (fade/push/wipe/split/reveal/cover/random)- duration: Transition duration (seconds)+ effect: Transition effect name (fade/push/wipe/split/strips/cover/random)+ duration: Transition duration (seconds, precise to milliseconds)advance_after: Auto-advance interval (seconds); None means manual advanceReturns:@@ -107,8 +90,9 @@ def create_transition_xml(element_name = trans_info['element']attrs = trans_info['attrs']- # Build speed attribute- speed = duration_to_speed(duration)+ # Build dur attribute (milliseconds, precise control)+ dur_ms = int(duration * 1000)+ dur_attr = f' dur="{dur_ms}"'# Build auto-advance attributeadv_attr = ''@@ -122,7 +106,7 @@ def create_transition_xml(effect_attrs = ' ' + effect_attrs# Generate XML- return f''' <p:transition spd="{speed}"{adv_attr}>+ return f''' <p:transition{dur_attr}{adv_attr}><p:{element_name}{effect_attrs}/></p:transition>'''@@ -277,7 +261,7 @@ def get_animation_help() -> str:if __name__ == '__main__':# Test output- print("=== Transition Effect XML Example (fade) ===")+ print("=== Transition Effect XML Example (fade, 500ms) ===")print(create_transition_xml('fade', 0.5))print()print("=== Entrance Animation XML Example (fade) ===")diff --git a/skills/ppt-master/scripts/svg_to_pptx.py b/skills/ppt-master/scripts/svg_to_pptx.pyindex dc091abc..82f7c8fc 100644--- a/skills/ppt-master/scripts/svg_to_pptx.py+++ b/skills/ppt-master/scripts/svg_to_pptx.py@@ -494,7 +494,7 @@ def create_slide_xml_with_svg(svg_rid: str,width_emu: int,height_emu: int,- transition: Optional[str] = None,+ transition: Optional[str] = 'fade',transition_duration: float = 0.5,auto_advance: Optional[float] = None,use_compat_mode: bool = True@@ -617,7 +617,7 @@ def create_pptx_with_native_svg(output_path: Path,canvas_format: Optional[str] = None,verbose: bool = True,- transition: Optional[str] = None,+ transition: Optional[str] = 'fade',transition_duration: float = 0.5,auto_advance: Optional[float] = None,use_compat_mode: bool = True,@@ -633,8 +633,8 @@ def create_pptx_with_native_svg(output_path: Output pathcanvas_format: Canvas formatverbose: Whether to output detailed information- transition: Transition effect (fade/push/wipe/split/reveal/cover/random)- transition_duration: Transition duration (seconds)+ transition: Transition effect (fade/push/wipe/split/strips/cover/random, default: fade)+ transition_duration: Transition duration in seconds (default: 0.4)auto_advance: Auto-advance interval (seconds)use_compat_mode: Use Office compatibility mode (PNG + SVG dual format, enabled by default)notes: Notes dictionary, key is slide number, value is notes content@@ -964,7 +964,7 @@ def create_pptx_with_native_svg(def main():# Build transition effect option list- transition_choices = list(TRANSITIONS.keys()) if TRANSITIONS else ['fade', 'push', 'wipe', 'split', 'reveal', 'cover', 'random']+ transition_choices = ['none'] + (list(TRANSITIONS.keys()) if TRANSITIONS else ['fade', 'push', 'wipe', 'split', 'strips', 'cover', 'random'])parser = argparse.ArgumentParser(description='PPT Master - SVG to PPTX Tool (Office Compatibility Mode)',@@ -976,8 +976,8 @@ Examples:%(prog)s examples/ppt169_demo --only legacy # Only SVG image version%(prog)s examples/ppt169_demo -o out.pptx # Explicit path (SVG ref → out_svg.pptx)- # Add page transition effects- %(prog)s examples/ppt169_demo --transition fade+ # Disable transition / change transition effect+ %(prog)s examples/ppt169_demo -t none%(prog)s examples/ppt169_demo -t push --transition-duration 1.0SVG source directory (-s):@@ -1023,9 +1023,9 @@ Speaker notes (enabled by default):help='(Deprecated, now default) Convert SVG to native DrawingML shapes')# Transition effect arguments- parser.add_argument('-t', '--transition', type=str, choices=transition_choices, default=None,- help='Page transition effect (default: none)')- parser.add_argument('--transition-duration', type=float, default=0.5,+ parser.add_argument('-t', '--transition', type=str, choices=transition_choices, default='fade',+ help='Page transition effect (default: fade, use "none" to disable)')+ parser.add_argument('--transition-duration', type=float, default=0.4,help='Transition duration in seconds (default: 0.5)')parser.add_argument('--auto-advance', type=float, default=None,help='Auto-advance interval in seconds (default: manual advance)')@@ -1092,12 +1092,15 @@ Speaker notes (enabled by default):if enable_notes:notes = find_notes_files(project_path, svg_files)+ # Convert 'none' string to None for downstream logic+ transition = args.transition if args.transition != 'none' else None+# Shared args for both runsshared_kwargs = dict(svg_files=svg_files,canvas_format=canvas_format,verbose=verbose,- transition=args.transition,+ transition=transition,transition_duration=args.transition_duration,auto_advance=args.auto_advance,use_compat_mode=not args.no_compat,