Working with Animation -- Aspose.Slides FOSS for Python
Aspose.Slides FOSS for Python provides classes for working with working with animation.
Overview
The key classes involved are:
IAnimationTimeLineAfterAnimationTypeAnimationTimeLineITextAnimationITextAnimationCollection
Getting Started
Install Aspose.Slides FOSS for Python:
pip install aspose-slides-fossBasic Usage
import aspose.slides_foss as slides
from aspose.slides_foss import ShapeType
from aspose.slides_foss import animation as anim
from aspose.slides_foss.export import SaveFormat
with slides.Presentation() as prs:
slide = prs.slides[0]
shape = slide.shapes.add_auto_shape(ShapeType.RECTANGLE, 10, 10, 100, 50)
effect = slide.timeline.main_sequence.add_effect(
shape, anim.EffectType.FADE,
anim.EffectSubtype.NONE,
anim.EffectTriggerType.ON_CLICK,
)
prs.save("animated.pptx", SaveFormat.PPTX)Tips and Best Practices
- Always dispose of document objects after use
- Handle file I/O exceptions when reading or writing files
- Check the API reference for the latest signatures
API Reference Summary
| Class | Description |
|---|---|
IAnimationTimeLine | See reference docs |
AfterAnimationType | See reference docs |
AnimationTimeLine | See reference docs |
ITextAnimation | See reference docs |
ITextAnimationCollection | See reference docs |
For full details, see the API Reference.