https://www.youtube.com/watch?v=Z-GpzGpXaLA
Always wanted to make bad apple myself, and it was quite a fun challenge. Also spent some time optimizing it with numba and i`m quite pleased with the results. This uses blender`s particle system and changes particles (cubes in this case) position according to positions of white pixels in a video.
This project uses python 3.9 and poetry.
- Clone the repo
git clone https://github.com/B0und/bad_apple_cube.git
- Install dependencies with poetry
or install manually with pip:
poetry install
pip install opencv-python,numba,numpy
-
Find and download
Touhou_-_Bad_Apple.mp4
. (I used 480x360 video, if your is different resolutions look at the scripts and change the constants) -
Use
python vid_to_frames.py
to convert video to jpeg images. -
Run
python image_to_locations.py
to create cube location files for blender to use. -
Open blender and add a particle system to a default Cube.
-
Go to the scripting tab at the top, create a new script and paste the contents of
blender_script.py
, edit the project location, size constants and run it. Warning: this script will take ~3GB of memory, so don`t run it on potato pc. -
Play the animation.
Distributed under the MIT License. See LICENSE
for more information.