Skip to content

Instantly share code, notes, and snippets.

@lcrs
Last active February 23, 2019 16:51
Show Gist options
  • Save lcrs/0036a84a6465d53167b34ed1447461c2 to your computer and use it in GitHub Desktop.
Save lcrs/0036a84a6465d53167b34ed1447461c2 to your computer and use it in GitHub Desktop.
List matchbox shaders and their descriptions
#!/usr/bin/python
import os, glob, xml.etree.ElementTree as et
html = open('/tmp/matchboxlist.html', 'w')
xmls = glob.glob('/opt/Autodesk/presets/2019.2.1/matchbox/shaders/LOGIK/*.xml')
xmls.sort()
for xml in xmls:
name = os.path.basename(xml)[:-4]
tree = et.parse(xml)
desc = ''
try:
desc = tree.getroot().attrib['Description']
except:
desc = '(no description in xml)'
html.write('<h1>%s</h1>\n<p>%s</p>\n\n' % (name, desc.encode('utf-8')))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment