Skip to content

MLC129: play(..., lag_ratio=...) does not stagger multiple animations

qual reports MLC129 when Scene.play receives two or more animations together with a lag_ratio keyword. Play kwargs are copied onto each compiled animation via setattr (scene.py compile_animations); each animation's own lag_ratio staggers its internal submobjects, not the animations against each other.

  • Default severity: warning
  • Minimum confidence: medium
  • Implementation phase: 2
  • Fix: none (moving lag_ratio into an AnimationGroup / LaggedStart constructor is suggested)

A single-animation play with lag_ratio (a legitimate submobject stagger), a group constructor carrying the kwarg, and starred argument lists stay silent.

Wrong

class Demo(Scene):
    def construct(self):
        square, dot = Square(), Dot()
        self.play(FadeIn(square), FadeIn(dot), lag_ratio=0.5)
class Demo(Scene):
    def construct(self):
        square, dot = Square(), Dot()
        self.play(LaggedStart(FadeIn(square), FadeIn(dot), lag_ratio=0.5))