Add preview generator and update preview textures

This commit is contained in:
stujones11 2017-03-11 20:02:55 +00:00
parent 616d9398f2
commit 01a3425ec8
89 changed files with 178 additions and 0 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 242 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 208 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 264 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 248 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 242 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 206 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 210 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 196 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 282 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 314 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 280 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 456 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 318 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 300 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 276 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 284 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 281 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 362 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 192 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 225 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 253 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 184 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 185 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 215 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 226 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 202 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 186 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 187 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 211 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 317 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 184 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 183 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 211 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 213 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 200 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 262 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 907 B

After

Width:  |  Height:  |  Size: 215 B

View File

@ -0,0 +1,44 @@
3d_armor/textures/3d_armor_helmet_wood.png:head
3d_armor/textures/3d_armor_chestplate_wood.png:torso
3d_armor/textures/3d_armor_leggings_wood.png:legs
3d_armor/textures/3d_armor_boots_wood.png:feet
3d_armor/textures/3d_armor_helmet_cactus.png:head
3d_armor/textures/3d_armor_chestplate_cactus.png:torso
3d_armor/textures/3d_armor_leggings_cactus.png:legs
3d_armor/textures/3d_armor_boots_cactus.png:feet
3d_armor/textures/3d_armor_helmet_steel.png:head
3d_armor/textures/3d_armor_chestplate_steel.png:torso
3d_armor/textures/3d_armor_leggings_steel.png:legs
3d_armor/textures/3d_armor_boots_steel.png:feet
3d_armor/textures/3d_armor_helmet_bronze.png:head
3d_armor/textures/3d_armor_chestplate_bronze.png:torso
3d_armor/textures/3d_armor_leggings_bronze.png:legs
3d_armor/textures/3d_armor_boots_bronze.png:feet
3d_armor/textures/3d_armor_helmet_gold.png:head
3d_armor/textures/3d_armor_chestplate_gold.png:torso
3d_armor/textures/3d_armor_leggings_gold.png:legs
3d_armor/textures/3d_armor_boots_gold.png:feet
3d_armor/textures/3d_armor_helmet_diamond.png:head
3d_armor/textures/3d_armor_chestplate_diamond.png:torso
3d_armor/textures/3d_armor_leggings_diamond.png:legs
3d_armor/textures/3d_armor_boots_diamond.png:feet
3d_armor/textures/3d_armor_helmet_mithril.png:head
3d_armor/textures/3d_armor_chestplate_mithril.png:torso
3d_armor/textures/3d_armor_leggings_mithril.png:legs
3d_armor/textures/3d_armor_boots_mithril.png:feet
3d_armor/textures/3d_armor_helmet_crystal.png:head
3d_armor/textures/3d_armor_chestplate_crystal.png:torso
3d_armor/textures/3d_armor_leggings_crystal.png:legs
3d_armor/textures/3d_armor_boots_crystal.png:feet
3d_armor/textures/3d_armor_helmet_admin.png:head
3d_armor/textures/3d_armor_chestplate_admin.png:torso
3d_armor/textures/3d_armor_leggings_admin.png:legs
3d_armor/textures/3d_armor_boots_admin.png:feet

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1005 B

After

Width:  |  Height:  |  Size: 550 B

View File

@ -0,0 +1 @@
hazmat_suit/textures/hazmat_suit_suit_hazmat.png:all

81
preview_gen.py Executable file
View File

@ -0,0 +1,81 @@
#!/usr/bin/python
import os
import sys
import Image
try :
arg = sys.argv[1]
except IndexError :
print "Usage: preview_gen.py <index_file>"
sys.exit(1)
try :
index = open(arg, "r")
except IOError :
print "Failed to open index file%s" %s (arg)
sys.exit(1)
preview = []
for line in index.readlines() :
if ":" in line :
line = line.rstrip('\n')
preview.append(line.split(':'))
print "Generating preview images..."
for fn, place in preview :
try :
imi = Image.open(fn)
except IOError :
print "Failed to open %s" % (fn)
sys.exit(1)
w, h = imi.size
if h != w / 2:
print "Incompatible texture size %s" % (fn)
sys.exit(1)
s = w / 64
imo = Image.new("RGBA", (16 * s, 32 * s))
if place == "all" or place == "head" :
face = (40 * s, 8 * s, 48 * s, 16 * s)
side_l = (56 * s, 8 * s, 57 * s, 16 * s)
side_r = (63 * s, 8 * s, 64 * s, 16 * s)
imo.paste(imi.crop(side_l), (4 * s, 0, 5 * s, 8 * s))
imo.paste(imi.crop(side_r), (11 * s, 0, 12 * s, 8 * s))
imo.paste(imi.crop(face), (4 * s, 0, 12 * s, 8 * s))
if place == "all" or place == "torso" :
arm = (44 * s, 20 * s, 48 * s, 32 * s)
body = (20 * s, 20 * s, 28 * s, 32 * s)
imo.paste(imi.crop(arm), (0 * s, 8 * s, 4 * s, 20 * s))
imo.paste(imi.crop(arm).transpose(Image.FLIP_LEFT_RIGHT),
(12 * s, 8 * s, 16 * s, 20 * s))
imo.paste(imi.crop(body), (4 * s, 8 * s, 12 * s, 20 * s))
if place == "all" or place == "legs" :
leg = (4 * s, 20 * s, 8 * s, 32 * s)
imo.paste(imi.crop(leg), (4 * s, 20 * s, 8 * s, 32 * s))
imo.paste(imi.crop(leg).transpose(Image.FLIP_LEFT_RIGHT),
(8 * s, 20 * s, 12 * s, 32 * s))
if place == "all" or place == "feet" :
boot = (20 * s, 4 * s, 24 * s, 11 * s)
imo.paste(imi.crop(boot), (4 * s, 25 * s, 8 * s, 32 * s))
imo.paste(imi.crop(boot).transpose(Image.FLIP_LEFT_RIGHT),
(8 * s, 25 * s, 12 * s, 32 * s))
size = (32 * s, 64 * s)
imo = imo.resize(size)
if place == "shield" :
shield = (0, 0, 16 * s, 16 * s)
imo.paste(imi.crop(shield), (16 * s, 32 * s, 32 * s, 48 * s))
outfile = fn.replace(".png", "_preview.png")
imo.save(outfile)
print outfile

View File

@ -0,0 +1,11 @@
shields/textures/shields_shield_wood.png:shield
shields/textures/shields_shield_enhanced_wood.png:shield
shields/textures/shields_shield_cactus.png:shield
shields/textures/shields_shield_enhanced_cactus.png:shield
shields/textures/shields_shield_steel.png:shield
shields/textures/shields_shield_bronze.png:shield
shields/textures/shields_shield_gold.png:shield
shields/textures/shields_shield_diamond.png:shield
shields/textures/shields_shield_mithril.png:shield
shields/textures/shields_shield_crystal.png:shield
shields/textures/shields_shield_admin.png:shield

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 298 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 312 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 462 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 283 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 289 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 405 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 409 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 300 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 312 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 284 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 373 B

View File

@ -0,0 +1,41 @@
technic_armor/textures/technic_armor_helmet_brass.png:head
technic_armor/textures/technic_armor_chestplate_brass.png:torso
technic_armor/textures/technic_armor_leggings_brass.png:legs
technic_armor/textures/technic_armor_boots_brass.png:feet
technic_armor/textures/technic_armor_shield_brass.png:shield
technic_armor/textures/technic_armor_helmet_cast.png:head
technic_armor/textures/technic_armor_chestplate_cast.png:torso
technic_armor/textures/technic_armor_leggings_cast.png:legs
technic_armor/textures/technic_armor_boots_cast.png:feet
technic_armor/textures/technic_armor_shield_cast.png:shield
technic_armor/textures/technic_armor_helmet_stainless.png:head
technic_armor/textures/technic_armor_chestplate_stainless.png:torso
technic_armor/textures/technic_armor_leggings_stainless.png:legs
technic_armor/textures/technic_armor_boots_stainless.png:feet
technic_armor/textures/technic_armor_shield_stainless.png:shield
technic_armor/textures/technic_armor_helmet_tin.png:head
technic_armor/textures/technic_armor_chestplate_tin.png:torso
technic_armor/textures/technic_armor_leggings_tin.png:legs
technic_armor/textures/technic_armor_boots_tin.png:feet
technic_armor/textures/technic_armor_shield_tin.png:shield
technic_armor/textures/technic_armor_helmet_lead.png:head
technic_armor/textures/technic_armor_chestplate_lead.png:torso
technic_armor/textures/technic_armor_leggings_lead.png:legs
technic_armor/textures/technic_armor_boots_lead.png:feet
technic_armor/textures/technic_armor_shield_lead.png:shield
technic_armor/textures/technic_armor_helmet_carbon.png:head
technic_armor/textures/technic_armor_chestplate_carbon.png:torso
technic_armor/textures/technic_armor_leggings_carbon.png:legs
technic_armor/textures/technic_armor_boots_carbon.png:feet
technic_armor/textures/technic_armor_shield_carbon.png:shield
technic_armor/textures/technic_armor_helmet_silver.png:head
technic_armor/textures/technic_armor_chestplate_silver.png:torso
technic_armor/textures/technic_armor_leggings_silver.png:legs
technic_armor/textures/technic_armor_boots_silver.png:feet
technic_armor/textures/technic_armor_shield_silver.png:shield

Binary file not shown.

Before

Width:  |  Height:  |  Size: 309 B

After

Width:  |  Height:  |  Size: 352 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 239 B

After

Width:  |  Height:  |  Size: 213 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 309 B

After

Width:  |  Height:  |  Size: 337 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 423 B

After

Width:  |  Height:  |  Size: 297 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 304 B

After

Width:  |  Height:  |  Size: 305 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 304 B

After

Width:  |  Height:  |  Size: 354 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 528 B

After

Width:  |  Height:  |  Size: 582 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 526 B

After

Width:  |  Height:  |  Size: 482 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 528 B

After

Width:  |  Height:  |  Size: 555 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 936 B

After

Width:  |  Height:  |  Size: 578 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 521 B

After

Width:  |  Height:  |  Size: 445 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 554 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 512 B

After

Width:  |  Height:  |  Size: 547 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 347 B

After

Width:  |  Height:  |  Size: 242 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 280 B

After

Width:  |  Height:  |  Size: 176 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 347 B

After

Width:  |  Height:  |  Size: 237 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 430 B

After

Width:  |  Height:  |  Size: 197 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 346 B

After

Width:  |  Height:  |  Size: 210 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 218 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 347 B

After

Width:  |  Height:  |  Size: 236 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 359 B

After

Width:  |  Height:  |  Size: 368 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 265 B

After

Width:  |  Height:  |  Size: 219 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 359 B

After

Width:  |  Height:  |  Size: 351 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 535 B

After

Width:  |  Height:  |  Size: 362 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 323 B

After

Width:  |  Height:  |  Size: 308 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 348 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 359 B

After

Width:  |  Height:  |  Size: 359 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 735 B

After

Width:  |  Height:  |  Size: 632 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 773 B

After

Width:  |  Height:  |  Size: 595 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 751 B

After

Width:  |  Height:  |  Size: 620 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 729 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 784 B

After

Width:  |  Height:  |  Size: 586 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 787 B

After

Width:  |  Height:  |  Size: 638 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 729 B

After

Width:  |  Height:  |  Size: 615 B