Skip to content

Commit

Permalink
Don't render right hand if holding gun (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
cxong committed Mar 4, 2017
1 parent 34be70b commit 83c103b
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 3 deletions.
Binary file modified graphics/chars/bodies/base/legs_idle_24x24.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified graphics/chars/bodies/base/legs_run_24x24.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified graphics/chars/bodies/base/src.blend
Binary file not shown.
Binary file modified graphics/chars/bodies/base/upper_idle_24x24.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified graphics/chars/bodies/base/upper_idle_handgun_24x24.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified graphics/chars/bodies/base/upper_run_24x24.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified graphics/chars/bodies/base/upper_run_handgun_24x24.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 8 additions & 1 deletion graphics/chars/bodies/make_spritesheet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,14 @@ do
else
frames=$idle_frames
fi
$BLENDER -b $INFILE -P render.py -- $i $action $frames $part
# Include right hand layer if the part is "upper" and action doesn't have
# "handgun"
layers=$i
if [[ $part == *"upper"* ]] && [[ $action != *"handgun"* ]]
then
layers=$i,2
fi
$BLENDER -b $INFILE -P render.py -- $layers $action $frames $part

DIMENSIONS=`identify -format "%wx%h" out/${part}_${action}_0_00.png`
OUTFILE=$1/${part}_${action}_${DIMENSIONS}.png
Expand Down
4 changes: 2 additions & 2 deletions graphics/chars/bodies/render.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from math import radians

argv = sys.argv[sys.argv.index("--") + 1:]
layer = argv[0]
layers = [int(layer) + 3 for layer in argv[0].split(',')]
action = argv[1]
frames = int(argv[2])
name = '{}_{}'.format(argv[3], action)
Expand All @@ -31,7 +31,7 @@
if i < 3:
scene.layers[i] = True
continue
scene.layers[i] = i == (int(layer) + 3)
scene.layers[i] = i in layers
render = scene.render
render.image_settings.file_format = 'PNG'
render.image_settings.color_mode ='RGBA'
Expand Down

0 comments on commit 83c103b

Please sign in to comment.