All skills
adithya-s-k avatar

/manimgl-best-practices

@2375ac0
by Adithya S Kadithya-s-k/manim_skill1.1k stars
94

Trigger when: (1) User mentions "manimgl" or "ManimGL" or "3b1b manim", (2) Code contains `from manimlib import *`, (3) User runs `manimgl` CLI commands, (4) Working with InteractiveScene, self.frame, self.embed(), ShowCreation(), or ManimGL-specific patterns. Best practices for ManimGL (Grant Sanderson's 3Blue1Brown version) - OpenGL-based animation engine with interactive development. Covers InteractiveScene, Tex with t2c, camera frame control, interactive mode (-se flag), 3D rendering, and checkpoint_paste() workflow. NOT for Manim Community Edition (which uses `manim` imports and `manim` CLI).

Use this Skill: https://skilld.dev/gh/adithya-s-k/manim_skill/manimgl-best-practices

This session only. Nothing lands on disk.

rulesanimations.md

≈973 tokens on demand. Your agent reads this file only when SKILL.md points to it.

ManimGL Animations

Animation System Overview

ManimGL's animation system is built around the Animation base class. Specialized subclasses handle creation, transformation, and indication effects.

Playing Animations

# Single animation
self.play(ShowCreation(circle))

# Multiple animations simultaneously
self.play(
    ShowCreation(circle),
    Write(text),
)

# With run_time
self.play(ShowCreation(circle), run_time=2)

# With rate function
self.play(ShowCreation(circle), rate_func=smooth)

Creation Animations

Animation Description
ShowCreation Draw a VMobject's path (NOT Create like in ManimCE)
Write Write text or LaTeX
DrawBorderThenFill Draw outline then fill
FadeIn Fade in with optional direction
FadeOut Fade out with optional direction
GrowFromCenter Scale up from center
GrowFromPoint Scale up from a point
GrowArrow Specialized for arrows
# ShowCreation for paths
self.play(ShowCreation(circle))

# Write for text
self.play(Write(Tex(R"\pi")))

# FadeIn with direction
self.play(FadeIn(square, shift=UP))

Transform Animations

Animation Description
Transform Morph one mobject into another (modifies original)
ReplacementTransform Replace source with target
TransformMatchingShapes Match similar shapes
TransformMatchingTex Match LaTeX parts
FadeTransform Fade while transforming
MoveToTarget Move to mobject's .target
# Transform (modifies circle, becomes square)
self.play(Transform(circle, square))

# ReplacementTransform (removes circle, adds square)
self.play(ReplacementTransform(circle, square))

# Using .target
circle.generate_target()
circle.target.shift(RIGHT * 2)
circle.target.set_color(RED)
self.play(MoveToTarget(circle))

Indication Animations

Animation Description
Indicate Flash/pulse to draw attention
ShowPassingFlash Flash along a path
Flash Burst of light
Circumscribe Draw circle/rect around
Wiggle Wiggle the mobject
FlashAround Flash effect around object
self.play(Indicate(important_text))
self.play(FlashAround(equation, run_time=2))

Movement Animations

# Using .animate syntax
self.play(circle.animate.shift(RIGHT * 2))
self.play(circle.animate.scale(2).set_color(RED))

# Rotate
self.play(Rotate(square, PI/2))
self.play(Rotate(square, 90 * DEGREES))  # Same thing

# MoveAlongPath
path = Line(LEFT, RIGHT)
self.play(MoveAlongPath(dot, path))

LaggedStart and Groups

# Staggered animations
self.play(LaggedStart(
    *[ShowCreation(mob) for mob in mobjects],
    lag_ratio=0.2
))

# AnimationGroup for simultaneous
self.play(AnimationGroup(
    ShowCreation(circle),
    Write(text),
    lag_ratio=0  # Simultaneous
))

# Succession for sequential
self.play(Succession(
    ShowCreation(circle),
    Write(text),
))

Animation Parameters

Common parameters for all animations:

Parameter Description
run_time Duration in seconds
rate_func Easing function (smooth, linear, etc.)
lag_ratio Stagger ratio for grouped animations
remover Remove mobject after animation
introducer Add mobject at animation start
self.play(
    ShowCreation(circle),
    run_time=3,
    rate_func=there_and_back,
)

Rate Functions

Common rate functions:

  • smooth - Default smooth easing
  • linear - Constant speed
  • rush_into - Fast start, slow end
  • rush_from - Slow start, fast end
  • there_and_back - Go and return
  • double_smooth - Extra smooth

Waiting

self.wait()       # Default pause
self.wait(2)      # 2 second pause
self.wait(0.5)    # Half second

Source: SKILL.md on GitHub

No alerts17d5 checks · Risk SAFE
  • Gen Agent Trust Hub17d

    The skill is an educational resource for the ManimGL mathematical animation library, providing best practices and functional examples. All code patterns, including CLI boilerplate and external asset references, are standard and safe for the intended use cases.

  • Socket17d

    No alerts

  • Snyk17d

    Risk: LOW · No issues

  • Runlayer7mo

    1/107 files flagged

  • ZeroLeaks5mo

    1 finding · Score: 86/100

Signed by skilld at 2375ac0. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 months ago.

Dormantupdated 8 months ago

README badge

README badge for adithya-s-k/manim_skill/manimgl-best-practices