Skip to content

MLC108: two animations write the same channel of the same mobject in one play

qual reports MLC108 when two animations of a single Scene.play write the same channel (points, style, opacity, membership, camera state) of the definitely-same live mobject. Animations interpolate in order on every frame, so the later write overwrites the earlier one.

  • Default severity: warning
  • Minimum confidence: high
  • Implementation phase: 2
  • Fix: none (a .animate chain merge is suggested in the message; the merge changes the shared rate function and path, so it is never applied automatically)

The rule fires only when both animations have a complete channel classification (channels_known = Yes) and the shared target identity is definite. Disjoint channels, different targets, Maybe aliasing, and loop-widened (non-singleton) targets stay silent.

Wrong

class Demo(Scene):
    def construct(self):
        square = Square()
        self.add(square)
        self.play(square.animate.shift(RIGHT), square.animate.rotate(PI))
class Demo(Scene):
    def construct(self):
        square = Square()
        self.add(square)
        self.play(square.animate.shift(RIGHT).rotate(PI))