Skip to content

Commit

Permalink
Render time step (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
cxong committed Feb 12, 2017
1 parent bb9f970 commit c622c43
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
Binary file modified graphics/chars/base.blend
Binary file not shown.
Binary file modified graphics/chars/char_32x32.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 13 additions & 4 deletions graphics/chars/char_render.py
Expand Up @@ -6,12 +6,21 @@
import sys
from math import radians

RESOLUTION = 32
FRAME_SKIP = 10

angle = -45
axis = 2 # z-axis
platform = bpy.data.objects["armature"]
bpy.data.scenes[0].render.image_settings.file_format = 'PNG'
bpy.data.scenes[0].render.image_settings.color_mode ='RGBA'
bpy.data.scenes[0].render.alpha_mode = 'TRANSPARENT'
scene = bpy.data.scenes[0]
render = scene.render
render.image_settings.file_format = 'PNG'
render.image_settings.color_mode ='RGBA'
render.alpha_mode = 'TRANSPARENT'
render.resolution_x = RESOLUTION
render.resolution_y = RESOLUTION
render.frame_map_new = 100 / FRAME_SKIP
scene.frame_end = 79 / FRAME_SKIP
original_path = 'out/char##'
path = 'out/char_{}_##'
for i in range(0, 8):
Expand All @@ -21,7 +30,7 @@
platform.rotation_euler = temp_rot

# set filename so that up is first
bpy.data.scenes[0].render.filepath = path.format((i + 6) % 8)
render.filepath = path.format((i + 6) % 8)

# render animation
bpy.ops.render.render(animation=True)
6 changes: 2 additions & 4 deletions graphics/chars/make_char_spritesheet.sh
Expand Up @@ -11,13 +11,11 @@ fi
BLENDER=/Applications/blender.app/Contents/MacOS/blender
INFILE=$1
$BLENDER -b $INFILE -P char_render.py

DIMENSIONS=`identify -format "%wx%h" out/char_0_00.png`
OUTFILE=$2_${DIMENSIONS}.png
rm $OUTFILE
command='montage -geometry +0+0 -background none -tile x8 out/char*.png -channel A $OUTFILE'

eval $command

montage -geometry +0+0 -background none -tile x8 out/char*.png -channel A $OUTFILE
chmod 644 $OUTFILE

rm -rf out/
Expand Down

0 comments on commit c622c43

Please sign in to comment.