motiongraphics / core /fx_animations.py
karthikeya1212's picture
Upload 26 files
7782338 verified
raw
history blame
1.5 kB
# app/core/animations/fx_animations.py
from pathlib import Path
from typing import Dict
def particle_burst(svg_path: Path, working_dir: Path, task_meta: Dict) -> Dict:
scene_name = "ParticleBurst"
scene_code = f'''
from manim import *
class {scene_name}(Scene):
def construct(self):
svg = SVGMobject("{svg_path.name}")
self.add(svg)
# TODO: Implement particle burst using many small dots animated outward
self.wait(0.5)
'''
return {"scene_name": scene_name, "scene_code": scene_code}
def smoke_effect(svg_path: Path, working_dir: Path, task_meta: Dict) -> Dict:
scene_name = "SmokeFX"
scene_code = f'''
from manim import *
class {scene_name}(Scene):
def construct(self):
svg = SVGMobject("{svg_path.name}")
# TODO: Add smoke overlay using alpha and per-frame masks or pre-rendered assets
self.play(FadeIn(svg), run_time=0.8)
self.wait(0.5)
'''
return {"scene_name": scene_name, "scene_code": scene_code}
def light_rays(svg_path: Path, working_dir: Path, task_meta: Dict) -> Dict:
scene_name = "LightRays"
scene_code = f'''
from manim import *
class {scene_name}(Scene):
def construct(self):
svg = SVGMobject("{svg_path.name}")
# TODO: Create rays using triangles/gradients and animate opacity
self.play(FadeIn(svg), run_time=0.6)
self.wait(0.5)
'''
return {"scene_name": scene_name, "scene_code": scene_code}