Skip to content

Animation

For creating your animation with DepthFlow, the recommended method is via #extending the main Scene class, and writing a custom update method changing Camera parameters over time.

Extending

Import the main class, create a new one inheriting from it, write an update method:

Circle animation example
from depthflow.scene import DepthScene

class MyAnimation(DepthScene):
    def update(self):
        self.state.offset = (
            math.cos(self.cycle),
            math.sin(self.cycle),
        )

You can use many temporal parameters such as:

Normalized time from 0-1 relative to total duration.

Normalized time from 0-2pi relative to total duration.

Elapsed time in seconds since the start of the animation.

Current frame count since the start of the animation.

See Exporting for realtime previews or encoding a video file.

Presets

DepthFlow will include a simple animation system in a future release.

  • For now, check the Examples directory on GitHub in how the Camera example videos are made, and the previous v0.9 hardcoded presets in the update method.