generating a list of used textures/flats in a map

Is there an easier way to generate a list of used textures/flats in a map than opening it in doom builder and writing down each texture/flat name by hand?

Share this post


Link to post

WinTex will display a list of textures and how many times they're used when you open a WAD and click the "Sidedefs" and "Sectors" lump entries underneath the E#M#/MAP## title, but there doesn't seem to be a way to export those lists to proper text file. You can export the individual lump entries to individual files, but it only displays a combination of texture names and garbage characters in a continuous string when viewed in a text editor.

Share this post


Link to post

I've been hoping someone would write something like this for quite a while now. Even more it'd be great if someone could write a script or program that would even merge the appropriate files automatically. :/

Share this post


Link to post

XWE will generate copy/pastable texture lists for maps, but doesn't do flats. I think DeePsea does both but don't have it installed right now.

Share this post


Link to post

Deepsea (the freeware version) can generate a list of used texture/flat with
F7 PWAD Lump Arranging and More
and optionally export this list to your favourite text editor.
Note: not for UDMF maps.


GZDoombuilder r1659 can generate a file of missing textures with
F4 Map Analysis
which is stored as mapname_errors.txt in the folder of the map.

Share this post


Link to post

Thx of the help, but I can't figure out how to generate the lists with XWE or Deepsea. Got any tips? The maps reference textures/flats from external texture wads so I'm trying to figure out what textures I need to import into the map wads. WinTex works good, but it's taking a while to write out every texture name.

Share this post


Link to post
GreyGhost said:

XWE will generate copy/pastable texture lists for maps, but doesn't do flats. I think DeePsea does both but don't have it installed right now.


Not quite, XWE generates a list of UNUSED textures.

The option is 'list unused textures' under the file menu. It will place a txt file on the root folder of the drive XWE is installed on, listing the textures that aren't used by any map in the same wad.

Share this post


Link to post

I wrote a simple python script that generates a list of all unique textures/flats given a directory of wads. it was pretty trivial to implement, but who knows maybe someone will find this useful.

#!/usr/bin/env python
# encoding: utf-8
"""
texList.py

Author: Ribbiks
Date:	12/29/2012

Generates list of unique textures & flats in a set of wads, given their directory

USAGE: python texList.py wadFolder/
"""

import os
import sys
import numpy as np

def main():
	wadDir = sys.argv[-1]
	wadList = os.listdir(wadDir)
	wadList = [n for n in wadList if n[-4:] == '.wad']

	dictT = {}
	dictF = {}

	for wad in wadList:
		# open file, get header info
		f = open(wadDir+wad,'rb')
		[pwad,nLmp,dirP] = np.fromfile(f,'<i4',3)

		# find all SIDEDEFS and SECTORS lumps
		f.seek(dirP)
		todoT = []	# todo[i] = (sidedefs_pointer, num_sidedefs)
		todoF = []
		for n in range(nLmp):
			[lmpP,lmpS] = np.fromfile(f,'<i4',2)
			name = f.read(8)
			if name == 'SIDEDEFS':
				todoT.append((lmpP,lmpS/30))
			elif name[:7] == 'SECTORS':
				todoF.append((lmpP,lmpS/26))
		
		# read textures from SIDEDEFS lumps
		for (pos,num) in todoT:
			f.seek(pos)
			for n in range(num):
				f.read(4)	# skip offset bytes
				dictT[f.read(8)] = 1
				dictT[f.read(8)] = 1
				dictT[f.read(8)] = 1
				f.read(2)	# skip sector bytes
		
		# read flats from SECTORS lumps
		for (pos,num) in todoF:
			f.seek(pos)
			for n in range(num):
				f.read(4)	# skip height bytes
				dictF[f.read(8)] = 1
				dictF[f.read(8)] = 1
				f.read(6)	# skip light/type/tag bytes

		f.close()

	of = open('output.txt','w')
	of.write('### TEXTURES ###\n\n')
	for i in dictT.keys():
		of.write(i+'\n')
	of.write('\n### FLATS ###\n\n')
	for i in dictF.keys():
		of.write(i+'\n')
	of.close()

if __name__ == '__main__':
	main()
not extensively tested. requires numpy (just because np.fromfile is convenient), but what self-respecting python install doesn't have numpy nowadays.

Share this post


Link to post
Vermil said:

Not quite, XWE generates a list of UNUSED textures.

The option is 'list unused textures' under the file menu. It will place a txt file on the root folder of the drive XWE is installed on, listing the textures that aren't used by any map in the same wad.

Select a map and you'll find a "List Used Textures" option in the Map menu, though it's not all that useful if there's a lot of maps in your wad.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now