animation

Submodule which allows to animate simultaneously various objects by specifying event times and durations of different visual effects.

See examples here.

animation1.py animation2.py

N.B.: this is still an experimental feature at the moment.

Animation

class vtkplotter.animation.Animation(totalDuration=None, timeResolution=0.02, showProgressBar=True, videoFileName='animation.mp4', videoFPS=12)[source]

Bases: vtkplotter.plotter.Plotter

A Plotter derived class that allows to animate simultaneously various objects by specifying event times and durations of different visual effects.

Parameters:
  • totalDuration (float) – expand or shrink the total duration of video to this value
  • timeResolution (float) – in secconds, save a frame at this rate
  • showProgressBar (bool) – show the progressbar
  • videoFileName (str) – output file name of the video
  • videoFPS (int) – desired value of the nr of frames per second.
changeAlphaBetween(alpha1, alpha2, acts=None, t=None, duration=None)[source]

Gradually change transparency for the input list of actors.

changeBackColor(c, acts=None, t=None, duration=None)[source]

Gradually change backface color for the input list of actors. An initial backface color should be set in advance.

changeColor(c, acts=None, t=None, duration=None)[source]

Gradually change color for the input list of actors.

changeLighting(style, acts=None, t=None, duration=None)[source]

Gradually change the lighting style for the input list of actors.

Allowed styles are: [metallic, plastic, shiny, glossy, default].

changeLineColor(c, acts=None, t=None, duration=None)[source]

Gradually change line color of the mesh edges for the input list of actors.

changeLineWidth(lw, acts=None, t=None, duration=None)[source]

Gradually change line width of the mesh edges for the input list of actors.

changeToSurface(acts=None, t=None)[source]

Switch representation to surface for the input list of actors at time t.

changeToWireframe(acts=None, t=None)[source]

Switch representation to wireframe for the input list of actors at time t.

fadeIn(acts=None, t=None, duration=None)[source]

Gradually switch on the input list of actors by increasing opacity.

fadeOut(acts=None, t=None, duration=None)[source]

Gradually switch off the input list of actors by increasing transparency.

meshErode(act=None, corner=6, t=None, duration=None)[source]

Erode a mesh by removing cells that are close to one of the 8 corners of the bounding box.

move(act=None, pt=(0, 0, 0), t=None, duration=None, style='linear')[source]

Smoothly change the position of a specific object to a new point in space.

moveCamera(camstart=None, camstop=None, t=None, duration=None)[source]

Smoothly move camera between two vtkCamera objects.

play()[source]

Play the internal list of events and save a video.

rotate(act=None, axis=(1, 0, 0), angle=0, t=None, duration=None)[source]

Smoothly rotate a specific object by a specified angle and axis.

scale(acts=None, factor=1, t=None, duration=None)[source]

Smoothly scale a specific object to a specified scale factor.

switchOff(acts=None, t=None, duration=None)[source]

Switch off the input list of actors.

switchOn(acts=None, t=None, duration=None)[source]

Switch on the input list of actors.