Large language models can generate executable code for educational animations, yet the rendered outputs often suffer from viewport overflow, element overlap, remnant content, and scale mismatch. These failures expose gaps in planning valid layouts, implementing visual constraints in code, and repairing errors revealed by rendering. We propose OmniManim, an educational animation generation framework that integrates explicit visual planning, spatially grounded code learning, and render-feedback-aware repair. Its Vision Agent predicts sparse keyframe layouts through coarse-to-fine bounding-box denoising with interpolation-aware constraints. Spatially Grounded Code Supervision (SGCS) aligns plan-conditioned code generation and diagnostic-guided repair with these layouts. Failure-Localized Render Policy Optimization (FLRPO) associates rendered failures with objects, time intervals, and code regions, and optimizes local patches using measured rendering gains, global constraint preservation, and edit costs. Together, these components connect visual plans to executable code and targeted self-repair. We also construct ManimLayout-1K for visual-layout and aligned code supervision, and EduRequire-500 for evaluating executability, instructional quality, visual quality, and efficiency. Experiments on EduRequire-500, TheoremExplainBench, and VisualEDU cover two agent-only backbones (GPT-5.4 and Gemini) and three SGCS/FLRPO-trained backbones (Qwen3-14B, Gemma, and Llama). On EduRequire-500, agent-only GPT-5.4 improves Manim animation generation over Code2Video, raising final render success from 0.923 to 0.986 and layout quality from 0.742 to 0.931, and reducing time from 148 s to 72 s.
翻译:暂无翻译