Commit e3e45cac authored by dylan grafmyre's avatar dylan grafmyre
Browse files

snap

parent bbb9fdfd
#!/bin/sh
find materials -type f | while read line; do echo $line; echo $line; done
find models -type f | while read line; do echo $line; echo $line; done
......@@ -52,19 +52,43 @@ def main_vmflint(argp, bspzip_addlist):
for model in models:
prop_is_zipped = model in bspzip_addlist_values
if not prop_is_zipped:
logging.error('using unpacked file: %r', model)
continue
logging.error('using unpacked prop: %r', model)
materials = set()
for model in models:
prop_is_zipped = model in bspzip_addlist_values
prop_in_source = os.path.isfile(model)
if not prop_in_source:
logging.error('using prop outside of source: %r', model)
materials = collections.defaultdict(list)
for leaf, material in vmf.iter_materials():
material_lower = material.lower()
if material_lower in materials:
continue
materials.add(material_lower)
materials[material_lower].append(leaf)
material_is_zipped = material_lower in bspzip_addlist_values_lower
materials_set = sorted(materials.keys())
for material in materials_set:
addlist_name = 'materials/{}.vmt'.format(material)
material_is_zipped = addlist_name in bspzip_addlist_values_lower
if not material_is_zipped:
logging.error('%r %r: using unpacked file: %r', leaf.name, leaf.attributes['id'], material)
usage = collections.defaultdict(list)
for leaf in materials[material]:
usage[leaf.name].append(int(leaf.attributes['id']))
for name in usage:
if len(usage[name]) > 3:
usage[name] = usage[name][:3] + ['...']
logging.error('using unpacked material: %r (%r)', material, list(usage.keys()))
for material in materials_set:
material_in_source = os.path.isfile(os.path.join('materials', '{}.vmt'.format(material)))
if not material_in_source:
usage = collections.defaultdict(list)
for leaf in materials[material]:
usage[leaf.name].append(int(leaf.attributes['id']))
for name in usage:
if len(usage[name]) > 3:
usage[name] = usage[name][:3] + ['...']
logging.error('using material outside of source: %r (%r)', material, list(usage.keys()))
def main(argp=None, argv=None):
if argp is None:
......
......@@ -72,12 +72,13 @@ class Vmf:
def iter_materials(self):
for leaf in self.walk():
if 'material' in leaf.attributes:
is_index = False
try:
is_index = str(int(leaf.attributes['material'])) == leaf.attributes['material']
except ValueError as err:
if 'with base 10' in str(err):
continue
raise
if 'with base 10' not in str(err):
raise
is_index = False
if is_index:
continue
yield (leaf, leaf.attributes['material'])
......@@ -115,12 +116,7 @@ class Vmf:
token_match = None
re_expr = None
for re_expr in vmf_tokens.tokens:
try:
token_match = next(re_expr.re.finditer(chunk))
except StopIteration as err:
continue
if token_match.start() != 0:
continue
token_match = re_expr.re.match(chunk)
if token_match:
break
......
materials/ttt_terrorcon/airplane/stamp.vtf
materials/ttt_terrorcon/airplane/stamp.vtf
materials/ttt_terrorcon/airplane/engine.vtf
materials/ttt_terrorcon/airplane/engine.vtf
materials/ttt_terrorcon/airplane/body.vtf
materials/ttt_terrorcon/airplane/body.vtf
materials/ttt_terrorcon/airplane/wingspan.vtf
materials/ttt_terrorcon/airplane/wingspan.vtf
materials/ttt_terrorcon/airplane/tire.vtf
materials/ttt_terrorcon/airplane/tire.vtf
materials/ttt_terrorcon/airplane/tail.vtf
materials/ttt_terrorcon/airplane/tail.vtf
materials/ttt_terrorcon/airplane/stamp.vmt
materials/ttt_terrorcon/airplane/stamp.vmt
materials/ttt_terrorcon/airplane/engine.vmt
materials/ttt_terrorcon/airplane/engine.vmt
materials/ttt_terrorcon/airplane/body.vmt
materials/ttt_terrorcon/airplane/body.vmt
materials/ttt_terrorcon/airplane/wingspan.vmt
materials/ttt_terrorcon/airplane/wingspan.vmt
materials/ttt_terrorcon/airplane/tire.vmt
materials/ttt_terrorcon/airplane/tire.vmt
materials/ttt_terrorcon/airplane/tail.vmt
materials/ttt_terrorcon/airplane/tail.vmt
materials/ttt_terrorcon/props/airplane/passenger_seat.vtf
materials/ttt_terrorcon/props/airplane/passenger_seat.vtf
materials/ttt_terrorcon/props/airplane/passenger_seat.vmt
materials/ttt_terrorcon/props/airplane/passenger_seat.vmt
models/ttt_terrorcon/airplane_2.mdl
models/ttt_terrorcon/airplane_2.mdl
models/ttt_terrorcon/airplane_2.dx80.vtx
models/ttt_terrorcon/airplane_2.dx80.vtx
models/ttt_terrorcon/airplane_2.dx90.vtx
models/ttt_terrorcon/airplane_2.dx90.vtx
models/ttt_terrorcon/airplane_2.phy
models/ttt_terrorcon/airplane_2.phy
models/ttt_terrorcon/airplane_2.vvd
models/ttt_terrorcon/airplane_2.vvd
models/ttt_terrorcon/airplane_2_aft_door.mdl
models/ttt_terrorcon/airplane_2_aft_door.mdl
models/ttt_terrorcon/airplane_2_aft_door.dx80.vtx
models/ttt_terrorcon/airplane_2_aft_door.dx80.vtx
models/ttt_terrorcon/airplane_2_aft_door.dx90.vtx
models/ttt_terrorcon/airplane_2_aft_door.dx90.vtx
models/ttt_terrorcon/airplane_2_aft_door.phy
models/ttt_terrorcon/airplane_2_aft_door.phy
models/ttt_terrorcon/airplane_2_aft_door.vvd
models/ttt_terrorcon/airplane_2_aft_door.vvd
models/ttt_terrorcon/airplane_2_aft-gear-port-door.mdl
models/ttt_terrorcon/airplane_2_aft-gear-port-door.mdl
models/ttt_terrorcon/airplane_2_aft-gear-port-door.dx80.vtx
models/ttt_terrorcon/airplane_2_aft-gear-port-door.dx80.vtx
models/ttt_terrorcon/airplane_2_aft-gear-port-door.dx90.vtx
models/ttt_terrorcon/airplane_2_aft-gear-port-door.dx90.vtx
models/ttt_terrorcon/airplane_2_aft-gear-port-door.phy
models/ttt_terrorcon/airplane_2_aft-gear-port-door.phy
models/ttt_terrorcon/airplane_2_aft-gear-port-door.vvd
models/ttt_terrorcon/airplane_2_aft-gear-port-door.vvd
models/ttt_terrorcon/airplane_2_aft-gear-starboard-door.mdl
models/ttt_terrorcon/airplane_2_aft-gear-starboard-door.mdl
models/ttt_terrorcon/airplane_2_aft-gear-starboard-door.dx80.vtx
models/ttt_terrorcon/airplane_2_aft-gear-starboard-door.dx80.vtx
models/ttt_terrorcon/airplane_2_aft-gear-starboard-door.dx90.vtx
models/ttt_terrorcon/airplane_2_aft-gear-starboard-door.dx90.vtx
models/ttt_terrorcon/airplane_2_aft-gear-starboard-door.phy
models/ttt_terrorcon/airplane_2_aft-gear-starboard-door.phy
models/ttt_terrorcon/airplane_2_aft-gear-starboard-door.vvd
models/ttt_terrorcon/airplane_2_aft-gear-starboard-door.vvd
models/ttt_terrorcon/airplane_2_bow-gear-port-door.mdl
models/ttt_terrorcon/airplane_2_bow-gear-port-door.mdl
models/ttt_terrorcon/airplane_2_bow-gear-port-door.dx80.vtx
models/ttt_terrorcon/airplane_2_bow-gear-port-door.dx80.vtx
models/ttt_terrorcon/airplane_2_bow-gear-port-door.dx90.vtx
models/ttt_terrorcon/airplane_2_bow-gear-port-door.dx90.vtx
models/ttt_terrorcon/airplane_2_bow-gear-port-door.phy
models/ttt_terrorcon/airplane_2_bow-gear-port-door.phy
models/ttt_terrorcon/airplane_2_bow-gear-port-door.vvd
models/ttt_terrorcon/airplane_2_bow-gear-port-door.vvd
models/ttt_terrorcon/airplane_2_bow-gear-starboard-door.mdl
models/ttt_terrorcon/airplane_2_bow-gear-starboard-door.mdl
models/ttt_terrorcon/airplane_2_bow-gear-starboard-door.dx80.vtx
models/ttt_terrorcon/airplane_2_bow-gear-starboard-door.dx80.vtx
models/ttt_terrorcon/airplane_2_bow-gear-starboard-door.dx90.vtx
models/ttt_terrorcon/airplane_2_bow-gear-starboard-door.dx90.vtx
models/ttt_terrorcon/airplane_2_bow-gear-starboard-door.phy
models/ttt_terrorcon/airplane_2_bow-gear-starboard-door.phy
models/ttt_terrorcon/airplane_2_bow-gear-starboard-door.vvd
models/ttt_terrorcon/airplane_2_bow-gear-starboard-door.vvd
models/ttt_terrorcon/airplane_2_gear.mdl
models/ttt_terrorcon/airplane_2_gear.mdl
models/ttt_terrorcon/airplane_2_gear.dx80.vtx
models/ttt_terrorcon/airplane_2_gear.dx80.vtx
models/ttt_terrorcon/airplane_2_gear.dx90.vtx
models/ttt_terrorcon/airplane_2_gear.dx90.vtx
models/ttt_terrorcon/airplane_2_gear.phy
models/ttt_terrorcon/airplane_2_gear.phy
models/ttt_terrorcon/airplane_2_gear.vvd
models/ttt_terrorcon/airplane_2_gear.vvd
models/ttt_terrorcon/airplane-gear.mdl
models/ttt_terrorcon/airplane-gear.mdl
models/ttt_terrorcon/airplane-gear.dx80.vtx
models/ttt_terrorcon/airplane-gear.dx80.vtx
models/ttt_terrorcon/airplane-gear.dx90.vtx
models/ttt_terrorcon/airplane-gear.dx90.vtx
models/ttt_terrorcon/airplane-gear.phy
models/ttt_terrorcon/airplane-gear.phy
models/ttt_terrorcon/airplane-gear.vvd
models/ttt_terrorcon/airplane-gear.vvd
models/ttt_terrorcon/passenger-seat.mdl
models/ttt_terrorcon/passenger-seat.mdl
models/ttt_terrorcon/passenger-seat.dx80.vtx
models/ttt_terrorcon/passenger-seat.dx80.vtx
models/ttt_terrorcon/passenger-seat.dx90.vtx
models/ttt_terrorcon/passenger-seat.dx90.vtx
models/ttt_terrorcon/passenger-seat.phy
models/ttt_terrorcon/passenger-seat.phy
models/ttt_terrorcon/passenger-seat.vvd
models/ttt_terrorcon/passenger-seat.vvd
materials/dev/dev_128.tga
materials/dev/dev_128.tga
materials/dev/dev_128.vmt
materials/dev/dev_128.vmt
materials/dev/dev_128.vtf
materials/dev/dev_128.vtf
materials/dev/dev_128.xcf
materials/dev/dev_128.xcf
materials/tools/fullalpha.tga
materials/tools/fullalpha.tga
materials/tools/fullalpha.vmt
materials/tools/fullalpha.vmt
materials/tools/fullalpha.vtf
materials/tools/fullalpha.vtf
materials/tools/fullalpha_metal.vmt
materials/tools/fullalpha_metal.vmt
materials/ttt_terrorcon/props/airplane_2/body.vmt
materials/ttt_terrorcon/props/airplane_2/body.vmt
materials/ttt_terrorcon/props/airplane_2/body.vtf
materials/ttt_terrorcon/props/airplane_2/body.vtf
materials/ttt_terrorcon/props/airplane_2/engine.vmt
materials/ttt_terrorcon/props/airplane_2/engine.vmt
materials/ttt_terrorcon/props/airplane_2/engine.vtf
materials/ttt_terrorcon/props/airplane_2/engine.vtf
materials/ttt_terrorcon/props/airplane_2/stamp.vmt
materials/ttt_terrorcon/props/airplane_2/stamp.vmt
materials/ttt_terrorcon/props/airplane_2/stamp.vtf
materials/ttt_terrorcon/props/airplane_2/stamp.vtf
materials/ttt_terrorcon/props/airplane_2/tail.vmt
materials/ttt_terrorcon/props/airplane_2/tail.vmt
materials/ttt_terrorcon/props/airplane_2/tail.vtf
materials/ttt_terrorcon/props/airplane_2/tail.vtf
materials/ttt_terrorcon/props/airplane_2/tire.vmt
materials/ttt_terrorcon/props/airplane_2/tire.vmt
materials/ttt_terrorcon/props/airplane_2/tire.vtf
materials/ttt_terrorcon/props/airplane_2/tire.vtf
materials/ttt_terrorcon/props/airplane_2/wingspan.vmt
materials/ttt_terrorcon/props/airplane_2/wingspan.vmt
materials/ttt_terrorcon/props/airplane_2/wingspan.vtf
materials/ttt_terrorcon/props/airplane_2/wingspan.vtf
materials/ttt_terrorcon/props/micstand/aluminum_pole.vmt
materials/ttt_terrorcon/props/micstand/aluminum_pole.vmt
materials/ttt_terrorcon/props/micstand/aluminum_pole.vtf
materials/ttt_terrorcon/props/micstand/aluminum_pole.vtf
materials/ttt_terrorcon/props/micstand/cable_vinyl.vmt
materials/ttt_terrorcon/props/micstand/cable_vinyl.vmt
materials/ttt_terrorcon/props/micstand/cable_vinyl.vtf
materials/ttt_terrorcon/props/micstand/cable_vinyl.vtf
materials/ttt_terrorcon/props/micstand/matte_plastic_black.vmt
materials/ttt_terrorcon/props/micstand/matte_plastic_black.vmt
materials/ttt_terrorcon/props/micstand/matte_plastic_black.vtf
materials/ttt_terrorcon/props/micstand/matte_plastic_black.vtf
materials/ttt_terrorcon/props/micstand/mic_grill.vmt
materials/ttt_terrorcon/props/micstand/mic_grill.vmt
materials/ttt_terrorcon/props/micstand/mic_grill.vtf
materials/ttt_terrorcon/props/micstand/mic_grill.vtf
materials/ttt_terrorcon/props/passenger_seat/passenger_seat.vmt
materials/ttt_terrorcon/props/passenger_seat/passenger_seat.vmt
materials/ttt_terrorcon/props/passenger_seat/passenger_seat.vtf
materials/ttt_terrorcon/props/passenger_seat/passenger_seat.vtf
models/ttt_terrorcon/airplane_2/aft-gear-port-door.dx80.vtx
models/ttt_terrorcon/airplane_2/aft-gear-port-door.dx80.vtx
models/ttt_terrorcon/airplane_2/aft-gear-port-door.dx90.vtx
models/ttt_terrorcon/airplane_2/aft-gear-port-door.dx90.vtx
models/ttt_terrorcon/airplane_2/aft-gear-port-door.mdl
models/ttt_terrorcon/airplane_2/aft-gear-port-door.mdl
models/ttt_terrorcon/airplane_2/aft-gear-port-door.phy
models/ttt_terrorcon/airplane_2/aft-gear-port-door.phy
models/ttt_terrorcon/airplane_2/aft-gear-port-door.sw.vtx
models/ttt_terrorcon/airplane_2/aft-gear-port-door.sw.vtx
models/ttt_terrorcon/airplane_2/aft-gear-port-door.vvd
models/ttt_terrorcon/airplane_2/aft-gear-port-door.vvd
models/ttt_terrorcon/airplane_2/aft-gear-starboard-door.dx80.vtx
models/ttt_terrorcon/airplane_2/aft-gear-starboard-door.dx80.vtx
models/ttt_terrorcon/airplane_2/aft-gear-starboard-door.dx90.vtx
models/ttt_terrorcon/airplane_2/aft-gear-starboard-door.dx90.vtx
models/ttt_terrorcon/airplane_2/aft-gear-starboard-door.mdl
models/ttt_terrorcon/airplane_2/aft-gear-starboard-door.mdl
models/ttt_terrorcon/airplane_2/aft-gear-starboard-door.phy
models/ttt_terrorcon/airplane_2/aft-gear-starboard-door.phy
models/ttt_terrorcon/airplane_2/aft-gear-starboard-door.sw.vtx
models/ttt_terrorcon/airplane_2/aft-gear-starboard-door.sw.vtx
models/ttt_terrorcon/airplane_2/aft-gear-starboard-door.vvd
models/ttt_terrorcon/airplane_2/aft-gear-starboard-door.vvd
models/ttt_terrorcon/airplane_2/aft_door.dx80.vtx
models/ttt_terrorcon/airplane_2/aft_door.dx80.vtx
models/ttt_terrorcon/airplane_2/aft_door.dx90.vtx
models/ttt_terrorcon/airplane_2/aft_door.dx90.vtx
models/ttt_terrorcon/airplane_2/aft_door.mdl
models/ttt_terrorcon/airplane_2/aft_door.mdl
models/ttt_terrorcon/airplane_2/aft_door.phy
models/ttt_terrorcon/airplane_2/aft_door.phy
models/ttt_terrorcon/airplane_2/aft_door.sw.vtx
models/ttt_terrorcon/airplane_2/aft_door.sw.vtx
models/ttt_terrorcon/airplane_2/aft_door.vvd
models/ttt_terrorcon/airplane_2/aft_door.vvd
models/ttt_terrorcon/airplane_2/airplane_2.dx80.vtx
models/ttt_terrorcon/airplane_2/airplane_2.dx80.vtx
models/ttt_terrorcon/airplane_2/airplane_2.dx90.vtx
models/ttt_terrorcon/airplane_2/airplane_2.dx90.vtx
models/ttt_terrorcon/airplane_2/airplane_2.mdl
models/ttt_terrorcon/airplane_2/airplane_2.mdl
models/ttt_terrorcon/airplane_2/airplane_2.phy
models/ttt_terrorcon/airplane_2/airplane_2.phy
models/ttt_terrorcon/airplane_2/airplane_2.sw.vtx
models/ttt_terrorcon/airplane_2/airplane_2.sw.vtx
models/ttt_terrorcon/airplane_2/airplane_2.vvd
models/ttt_terrorcon/airplane_2/airplane_2.vvd
models/ttt_terrorcon/airplane_2/bow-gear-port-door.dx80.vtx
models/ttt_terrorcon/airplane_2/bow-gear-port-door.dx80.vtx
models/ttt_terrorcon/airplane_2/bow-gear-port-door.dx90.vtx
models/ttt_terrorcon/airplane_2/bow-gear-port-door.dx90.vtx
models/ttt_terrorcon/airplane_2/bow-gear-port-door.mdl
models/ttt_terrorcon/airplane_2/bow-gear-port-door.mdl
models/ttt_terrorcon/airplane_2/bow-gear-port-door.phy
models/ttt_terrorcon/airplane_2/bow-gear-port-door.phy
models/ttt_terrorcon/airplane_2/bow-gear-port-door.sw.vtx
models/ttt_terrorcon/airplane_2/bow-gear-port-door.sw.vtx
models/ttt_terrorcon/airplane_2/bow-gear-port-door.vvd
models/ttt_terrorcon/airplane_2/bow-gear-port-door.vvd
models/ttt_terrorcon/airplane_2/bow-gear-starboard-door.dx80.vtx
models/ttt_terrorcon/airplane_2/bow-gear-starboard-door.dx80.vtx
models/ttt_terrorcon/airplane_2/bow-gear-starboard-door.dx90.vtx
models/ttt_terrorcon/airplane_2/bow-gear-starboard-door.dx90.vtx
models/ttt_terrorcon/airplane_2/bow-gear-starboard-door.mdl
models/ttt_terrorcon/airplane_2/bow-gear-starboard-door.mdl
models/ttt_terrorcon/airplane_2/bow-gear-starboard-door.phy
models/ttt_terrorcon/airplane_2/bow-gear-starboard-door.phy
models/ttt_terrorcon/airplane_2/bow-gear-starboard-door.sw.vtx
models/ttt_terrorcon/airplane_2/bow-gear-starboard-door.sw.vtx
models/ttt_terrorcon/airplane_2/bow-gear-starboard-door.vvd
models/ttt_terrorcon/airplane_2/bow-gear-starboard-door.vvd
models/ttt_terrorcon/airplane_2/gear.dx80.vtx
models/ttt_terrorcon/airplane_2/gear.dx80.vtx
models/ttt_terrorcon/airplane_2/gear.dx90.vtx
models/ttt_terrorcon/airplane_2/gear.dx90.vtx
models/ttt_terrorcon/airplane_2/gear.mdl
models/ttt_terrorcon/airplane_2/gear.mdl
models/ttt_terrorcon/airplane_2/gear.phy
models/ttt_terrorcon/airplane_2/gear.phy
models/ttt_terrorcon/airplane_2/gear.sw.vtx
models/ttt_terrorcon/airplane_2/gear.sw.vtx
models/ttt_terrorcon/airplane_2/gear.vvd
models/ttt_terrorcon/airplane_2/gear.vvd
models/ttt_terrorcon/props/defaultcube.dx80.vtx
models/ttt_terrorcon/props/defaultcube.dx80.vtx
models/ttt_terrorcon/props/defaultcube.dx90.vtx
models/ttt_terrorcon/props/defaultcube.dx90.vtx
models/ttt_terrorcon/props/defaultcube.mdl
models/ttt_terrorcon/props/defaultcube.mdl
models/ttt_terrorcon/props/defaultcube.phy
models/ttt_terrorcon/props/defaultcube.phy
models/ttt_terrorcon/props/defaultcube.sw.vtx
models/ttt_terrorcon/props/defaultcube.sw.vtx
models/ttt_terrorcon/props/defaultcube.vvd
models/ttt_terrorcon/props/defaultcube.vvd
models/ttt_terrorcon/props/micstand.dx80.vtx
models/ttt_terrorcon/props/micstand.dx80.vtx
models/ttt_terrorcon/props/micstand.dx90.vtx
models/ttt_terrorcon/props/micstand.dx90.vtx
models/ttt_terrorcon/props/micstand.mdl
models/ttt_terrorcon/props/micstand.mdl
models/ttt_terrorcon/props/micstand.phy
models/ttt_terrorcon/props/micstand.phy
models/ttt_terrorcon/props/micstand.sw.vtx
models/ttt_terrorcon/props/micstand.sw.vtx
models/ttt_terrorcon/props/micstand.vvd
models/ttt_terrorcon/props/micstand.vvd
models/ttt_terrorcon/props/passenger-seat.dx80.vtx
models/ttt_terrorcon/props/passenger-seat.dx80.vtx
models/ttt_terrorcon/props/passenger-seat.dx90.vtx
models/ttt_terrorcon/props/passenger-seat.dx90.vtx
models/ttt_terrorcon/props/passenger-seat.mdl
models/ttt_terrorcon/props/passenger-seat.mdl
models/ttt_terrorcon/props/passenger-seat.phy
models/ttt_terrorcon/props/passenger-seat.phy
models/ttt_terrorcon/props/passenger-seat.sw.vtx
models/ttt_terrorcon/props/passenger-seat.sw.vtx
models/ttt_terrorcon/props/passenger-seat.vvd
models/ttt_terrorcon/props/passenger-seat.vvd
This diff is collapsed.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment