Skip to content

Turning 3D models into 2D sprites

Dmitry Degtyarev edited this page Nov 12, 2023 · 1 revision
  1. To convert a 3D animated model into a 2D sprite sheet, you need to install Blender.

  2. Download the "isometric-template.blend" from here. This is a prepared scene where the camera has the correct settings for isometric rendering.

  3. Delete the default cube and hide the floor plane. Import an animated model into the scene. Switch to the "Animation" tab. Ensure that the model fits within the rendering frame. If not, resize it. Don't forget to import weapons and attach them to the armature.

  4. Rename the animation inside the armature to one of the following, depending on the animation:

    • run_slow
    • run_fast
    • stunned
    • death
    • floating
  5. Switch to the "Scripting" tab. Open the latest render_8_direction_sprites.py script. Run the script. The editor should lag if it's generating correctly.

  6. Go to the model's folder. There should be a "script-export" folder nearby. It will contain subfolders named after the animation actions. Find the action that you want to translate into sprites.

  7. Download Godot executable to the <godot-path>

  8. Download this script which merges slides together into one sprite sheet to the <generate-atlas-script-path>

  9. Run the following command to merge slides exported from the Blender:

    <godot-path>/<godot-console-executable> -s "<generate-atlas-script-path>" --path="<export-path>" --name="<unit-type>_<animation-name>"
    

    So, for example, on Windows the command should look like this:

    C:/Users/user/Downloads/godot/Godot_v4.0.2-stable_win64.exe -s "C:\Users\user\Downloads\youtd2\Scenes\GenerateAtlas.gd" --path="run_slow" --name="orc-normal_run-slow"
    

    You should see:

    GenerateAtlas.gd begin
    GenerateAtlas.gd end
    

    And the end result is a folder "generated-atlases" with sprite sheets in the folder where you executed the script.

  10. Upload the sprite sheet, Blender project, FBX animations to the Google Drive. Keep file arrangement consistent, example.

Clone this wiki locally