$npx -y skills add calesthio/OpenMontage --skill manimgl-best-practicesTrigger 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
| 1 | ## How to use |
| 2 | |
| 3 | Read individual rule files for detailed explanations and code examples: |
| 4 | |
| 5 | ### Core Concepts |
| 6 | - [rules/scenes.md](rules/scenes.md) - InteractiveScene, Scene types, and construct method |
| 7 | - [rules/mobjects.md](rules/mobjects.md) - Mobject types, VMobject, Groups, and positioning |
| 8 | - [rules/animations.md](rules/animations.md) - Animation classes, playing animations, and timing |
| 9 | |
| 10 | ### Creation & Transformation |
| 11 | - [rules/creation-animations.md](rules/creation-animations.md) - ShowCreation, Write, FadeIn, DrawBorderThenFill |
| 12 | - [rules/transform-animations.md](rules/transform-animations.md) - Transform, ReplacementTransform, TransformMatchingTex |
| 13 | - [rules/animation-groups.md](rules/animation-groups.md) - LaggedStart, Succession, AnimationGroup |
| 14 | |
| 15 | ### Text & Math |
| 16 | - [rules/tex.md](rules/tex.md) - Tex class, raw strings R"...", and LaTeX rendering |
| 17 | - [rules/text.md](rules/text.md) - Text mobjects, fonts, and styling |
| 18 | - [rules/t2c.md](rules/t2c.md) - tex_to_color_map (t2c) for coloring math expressions |
| 19 | |
| 20 | ### Styling & Appearance |
| 21 | - [rules/colors.md](rules/colors.md) - Color constants, gradients, RGB, hex, GLSL coloring |
| 22 | - [rules/styling.md](rules/styling.md) - Fill, stroke, opacity, backstroke, gloss, shadow |
| 23 | |
| 24 | ### 3D & Camera |
| 25 | - [rules/3d.md](rules/3d.md) - 3D objects, surfaces, Sphere, Torus, parametric surfaces, lighting |
| 26 | - [rules/camera.md](rules/camera.md) - frame.reorient(), Euler angles, fix_in_frame(), camera animations |
| 27 | |
| 28 | ### Interactive Development |
| 29 | - [rules/interactive.md](rules/interactive.md) - Interactive mode with `-se` flag, checkpoint_paste() |
| 30 | - [rules/frame.md](rules/frame.md) - self.frame, camera control, reorient, and zooming |
| 31 | - [rules/embedding.md](rules/embedding.md) - self.embed() for IPython debugging, touch() mode |
| 32 | |
| 33 | ### Configuration & CLI |
| 34 | - [rules/cli.md](rules/cli.md) - manimgl command, flags (-w, -o, -se, -l, -h), rendering options |
| 35 | - [rules/config.md](rules/config.md) - custom_config.yml, directories, camera settings, quality presets |
| 36 | |
| 37 | ## Working Examples |
| 38 | |
| 39 | Complete, tested example files demonstrating common patterns: |
| 40 | |
| 41 | - [examples/basic_animations.py](examples/basic_animations.py) - Basic shapes, text, and animations |
| 42 | - [examples/math_visualization.py](examples/math_visualization.py) - LaTeX equations and mathematical content |
| 43 | - [examples/graph_plotting.py](examples/graph_plotting.py) - Axes, functions, and graphing |
| 44 | - [examples/3d_visualization.py](examples/3d_visualization.py) - 3D scenes with camera control and surfaces |
| 45 | - [examples/updater_patterns.py](examples/updater_patterns.py) - Dynamic animations with updaters |
| 46 | |
| 47 | ## Scene Templates |
| 48 | |
| 49 | Copy and modify these templates to start new projects: |
| 50 | |
| 51 | - [templates/basic_scene.py](templates/basic_scene.py) - Standard 2D scene template |
| 52 | - [templates/interactive_scene.py](templates/interactive_scene.py) - InteractiveScene with self.embed() |
| 53 | - [templates/3d_scene.py](templates/3d_scene.py) - 3D scene with frame.reorient() |
| 54 | - [templates/math_scene.py](templates/math_scene.py) - Mathematical derivations and equations |
| 55 | |
| 56 | ## Quick Reference |
| 57 | |
| 58 | ### Basic Scene Structure |
| 59 | ```python |
| 60 | from manimlib import * |
| 61 | |
| 62 | class MyScene(InteractiveScene): |
| 63 | def construct(self): |
| 64 | # Create mobjects |
| 65 | circle = Circle() |
| 66 | |
| 67 | # Add to scene (static) |
| 68 | self.add(circle) |
| 69 | |
| 70 | # Or animate |
| 71 | self.play(ShowCreation(circle)) # Note: ShowCreation, not Create |
| 72 | |
| 73 | # Wait |
| 74 | self.wait(1) |
| 75 | ``` |
| 76 | |
| 77 | ### Render Command |
| 78 | ```bash |
| 79 | # Render and preview |
| 80 | manimgl scene.py MyScene |
| 81 | |
| 82 | # Interactive mode - drop into shell at line 15 |
| 83 | manimgl scene.py MyScene -se 15 |
| 84 | |
| 85 | # Write to file |
| 86 | manimgl scene.py MyScene -w |
| 87 | |
| 88 | # Low quality for testing |
| 89 | manimgl scene.py MyScene -l |
| 90 | ``` |
| 91 | |
| 92 | ### Key Differences from ManimCE |
| 93 | |
| 94 | | Feature | ManimGL (3b1b) | Manim Community | |
| 95 | |---------|----------------|-----------------| |
| 96 | | Import | `from manimlib import *` | `from manim import *` | |
| 97 | | CLI | `manimgl` | `manim` | |
| 98 | | Math text | `Tex(R"\pi")` | `MathTex(r"\pi")` | |
| 99 | | Scene | `InteractiveScene` | `Scene` | |
| 100 | | Create anim | `ShowCreation` | `Create` | |
| 101 | | Camera | `self.frame` | `self.camera.frame` | |
| 102 | | Fix in frame | `mob.fix_in_frame()` | `self.add_fixed_in_frame_mobjects(mob)` | |
| 103 | | Package | `manimgl` (PyPI) | `manim` (PyPI) | |
| 104 | |
| 105 | ### Interactive Development Workflow |
| 106 | |
| 107 | ManimGL's killer feature is interactive development: |
| 108 | |
| 109 | ```bash |
| 110 | # Start at line 20 with state preserved |
| 111 | manimgl sc |