MobMorphMixin

Qualified name: algan.animatable\_base.mob\_morph.MobMorphMixin

class MobMorphMixin[source]

Bases: object

become plus the structural helpers used to align arbitrary Mobs.

Methods

become

Transform any Mob hierarchy into any other Mob hierarchy.

get_non_component_children

Return direct user children, excluding a Mob's structural components.

become(other_mob, *, detach_history=True, minimize_movement=False, strategy='auto')[source]

Transform any Mob hierarchy into any other Mob hierarchy.

Structural containers are transparent to pairing: renderer-facing primitives are matched by concrete type, primitive family and either traversal order or spatial proximity. Same-kind pairs use structural point alignment and different primitive families convert through a cubic-PN triangle soup. ImageMob pairs cross-dissolve because image textures have no geometric adapter, and so does a pair that changes whether a circuit is filled: that flag is read once per render rather than per frame, so no morph can show it changing. The pairing prefers a counterpart that does not force the change. strategy may be "auto", "morph" (reject every non-geometric pair), or "dissolve" (dissolve the whole root).

With the default detach_history=True, the returned Mob has the target’s hierarchy and is spliced into this Mob’s parent slot; use it for later animation. Surplus target primitives fade in as they grow from collapsed, target-shaped geometry at nearby source points, while surplus sources fade out as they shrink to points. detach_history=False keeps identity for compatibility and therefore uses a dissolve where a target-class replacement would be required. Updaters remain attached to replaced sources rather than being migrated to replacements.

Notes

Cross-kind geometric morphs pair independent PN triangles, so a surface can show seams while triangles move to new counterparts. Bezier outlines are triangulated at the primitive-family swap, making the silhouette at that instant an approximation. A mesh-to-bezier morph likewise travels through the target’s filled triangulation rather than growing cubic curves. Cached glyph views held before a cross-kind replacement remain views of the replaced source; reacquire them from the returned Mob when it is text.

Parameters:
  • other_mob (Mob)

  • detach_history (bool)

  • minimize_movement (bool)

  • strategy (str)

Return type:

Mob

get_non_component_children()[source]

Return direct user children, excluding a Mob’s structural components.

Return type:

list[Mob]