MLC126: family child is not a Mobject, or not a VMobject in a VGroup¶
qual reports MLC126 for two confirmed family violations
(DESIGN §3.4):
- A child of
Mobject.add(...),Group(...), orVGroup(...)whose kind is known not to be a Mobject at all — a numeric / string / boolean literal, an Animation or Scene instance, or an instance of a fully resolved non-Manim class.Mobject.addvalidates children and raisesTypeError. -
A child of a vectorized family (
VGroup(...)or.add(...)on a VMobject instance) that is known to be a plain Mobject but not a VMobject — for exampleImageMobject. Vectorized containers store Bézier point data and reject such children;Groupis the heterogeneous container. -
Default severity:
error - Minimum confidence:
high - Implementation phase:
1 - Fix: none (
Group(...)is suggested in the message)
Unknown child kinds never fire: a value returned by an unresolved function
or helper stays silent. Scene.add has different semantics and is not
covered by this rule.
Wrong¶
class Demo(Scene):
def construct(self):
image = ImageMobject("photo.png")
group = VGroup(Square(), image) # plain Mobject in a VGroup
group.add(3) # literal is not a Mobject