B0und / bad_apple_cube

Code for creating Bad Apple animation in Blender.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool


Logo

Bad Apple on a 3D Cube

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.

Installation

This project uses python 3.9 and poetry.

  1. Clone the repo
    git clone https://github.com/B0und/bad_apple_cube.git
  2. Install dependencies with poetry
    poetry install
    or install manually with pip:
    pip install opencv-python,numba,numpy

Usage

  1. Find and download Touhou_-_Bad_Apple.mp4. (I used 480x360 video, if your is different resolutions look at the scripts and change the constants)

  2. Use python vid_to_frames.py to convert video to jpeg images.

  3. Run python image_to_locations.py to create cube location files for blender to use.

  4. Open blender and add a particle system to a default Cube.

  5. 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.

  6. Play the animation.

License

Distributed under the MIT License. See LICENSE for more information.

About

Code for creating Bad Apple animation in Blender.

License:MIT License


Languages

Language:Python 100.0%