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:

  • IAnimationTimeLine
  • AfterAnimationType
  • AnimationTimeLine
  • ITextAnimation
  • ITextAnimationCollection

Getting Started

Install Aspose.Slides FOSS for Python:

pip install aspose-slides-foss

Basic 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

ClassDescription
IAnimationTimeLineSee reference docs
AfterAnimationTypeSee reference docs
AnimationTimeLineSee reference docs
ITextAnimationSee reference docs
ITextAnimationCollectionSee reference docs

For full details, see the API Reference.

See Also

 English