Mode d’emploi
- Copiez la commande et examinez le paquet avant de l’installer dans votre environnement agent.
- Consultez le document original pour les outils, identifiants et environnements requis.
- Décrivez les entrées et le livrable souhaité ; comparez la sortie aux sources.
npx skills add https://github.com/nphu0811/pmg-skills --skill pmg-morphAvant de commencer
- L’installation n’inclut ni abonnement au modèle, ni quota API, ni accès aux fichiers.
- Étoiles et installations reflètent l’activité, pas un test indépendant de qualité ou de sécurité.
Rendu depuis le dépôt source en conservant titres, exemples, code, tableaux, liens et images.
PMG Morph Engine (pmg-morph)
Responsibility and dependencies
Technical cross-slide Morph compilation: XML, object matching, persistent !! identities, geometry compatibility, anchor validation and Morph parameters. Choreography invokes these helpers and owns narrative motion choices.
Dependencies: pmg-engine; motiongraphkit transition APIs; shared object identities. All generated candidates must pass PMGOrchestrator before delivery; direct save/COM snippets below are lower-level composition examples, not independent production entrypoints.
PowerPoint Morph is the hardware-accelerated motion interpolation engine of PMG. When configured with strict OpenXML attributes, it produces continuous animations whose actual playback frame rate must be measured.
1. The !! Naming Invariant
To morph Shape A on Slide 1 into Shape B on Slide 2, both shapes must share an identical custom name prefixed with !! in PowerPoint's shape tree:
<!-- Slide 1 -->
<p:cNvPr id="101" name="!!Hero_Focus"/>
<!-- Slide 2 -->
<p:cNvPr id="205" name="!!Hero_Focus"/>When PowerPoint detects matching !! prefixes:
- Compatible objects can be matched explicitly; unsupported pairs can still cross-fade.
- PowerPoint interpolates coordinates:
(x1, y1, w1, h1, rot1) -> (x2, y2, w2, h2, rot2). - It smoothly blends fills, outlines, and opacity channels subject to PowerPoint compatibility and measured playback.
2. Dynamic Thematic Traveling Entity ("Vật Thể Bay Xuyên Slide")
A persistent traveling entity must match the specific topic of the presentation:
- Space & Aerospace: 3D Rotating Planet, Satellite Probe, Rocket, Astronaut
- Music & Media (Spotify Style): Glowing Vinyl Disc, Soundwave Pulse, 3D Floating Earbud
- Technology & AI: Cyber Core, Neural Data Orb, Glowing Tech Badge
- Environment & Ecology: Floating Green Leaf, Pure Water Droplet, Sprout
- Business & Finance: 3D Growth Arrow, Golden Token, Metric Compass Pin
- Healthcare & Biotech: DNA Double Helix, Molecular Sphere, Heartbeat Pulse
- Culture & Literature: Floating Lantern, Calligraphy Quill, Imperial Seal
Slide 1 (Entry / Launch):
[ !!Traveling_Hero ] at (x: -2.5", y: 4.2", rot: +20°) ---> Enters from left margin
↓ (Morph 1.6s)
Slide 2 (Ascent & Survey):
[ !!Traveling_Hero ] at (x: 5.8", y: 1.8", rot: -10°) ---> Glides above Hero Title
↓ (Morph 1.6s)
Slide 3 (Spotlight & Docking):
[ !!Traveling_Hero ] at (x: 10.2", y: 4.0", rot: +15°) ---> Hovers near Key Metrics
↓ (Morph 1.6s)
Slide 4 (Graceful Exit):
[ !!Traveling_Hero ] at (x: 14.5", y: 1.0", rot: -25°) ---> Departs into right marginStaging Rules for Traveling Entities
- Off-Screen Safe Coordinates:
- Left Off-Screen: $X \le -2.0 \text{ inches}$ ($X \le -1828800 \text{ EMUs}$)
- Right Off-Screen: $X \ge 13.5 \text{ inches}$ ($X \ge 12344400 \text{ EMUs}$)
- Top Off-Screen: $Y \le -2.0 \text{ inches}$
- Bottom Off-Screen: $Y \ge 7.8 \text{ inches}$
- Dynamic Rotation (`rot`):
- In PowerPoint OpenXML, rotation is expressed in 60,000ths of a degree (e.g., $15^\circ = 900,000$).
- As the entity ascends, tilt upwards ($-10^\circ$ to $-20^\circ$); as it swoops down, tilt forwards ($+15^\circ$ to $+25^\circ$).
- Aspect-Ratio Lock:
$$\frac{W2}{W1} = \frac{H2}{H1}$$ Never scale width or height disproportionately during flight.
3. OpenXML Morph Specification
The morph transition element must be injected into the slide's XML root (ppt/slides/slide{N}.xml):
<p:transition xmlns:p14="http://schemas.microsoft.com/office/powerpoint/2010/main"
xmlns:p159="http://schemas.microsoft.com/office/powerpoint/2015/09/main"
spd="slow"
advClick="1">
<p159:morph option="byObject"/>
</p:transition>Morph Option Modes
option="byObject": The standard 60 FPS spatial interpolation mode for shapes, cards, 3D models, and traveling entities.option="byWord": Fluid kinetic typography morphing where shared words glide to their new positions.option="byChar": Anagram-style character deformation.
Transition Timing Standards
- Standard Spatial Flow:
duration = 1400ms – 1600ms. - Traveling Mascot Flight:
duration = 1600ms – 1800ms. - Macro Camera Zoom:
duration = 1800ms – 2000ms.
4. Automated CLI & Python API
Inject Morph transitions using:
python scripts/pptx_morph_injector.py Presentation.pptx --type morph --dur 1600 --mode byObjectOr in Python code:
from scripts.motion_graph_kit import MotionDeck
deck = MotionDeck()
s1 = deck.add_slide(transition="none")
deck.add_thematic_traveling_entity(s1, "assets/satellite.png", left=-2.5, top=4.0, rot_deg=20)
s2 = deck.add_slide(transition="morph", duration_ms=1600)
deck.add_thematic_traveling_entity(s2, "assets/satellite.png", left=6.0, top=1.8, rot_deg=-10)
