Add files via upload

This commit is contained in:
Legonzaur
2023-07-17 15:43:07 +02:00
committed by GitHub
commit cc2b8afa33
4 changed files with 462 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
from rpak import Rpak
from progressDisplay import percent_complete
import os
from itertools import chain
path = "."
rpaks: list[Rpak] = []
for file in os.listdir(path):
if file.endswith(".rpak"):
rpaks.append(Rpak(file))
textures = map(lambda x : x.Assets['textures'], rpaks)
textures = list(chain.from_iterable(textures))
textureGuids = map(lambda x : x.assetEntry.nameHash, textures)
textureDict = dict(zip(textureGuids, textures))
materials = map(lambda x : x.Assets['materials'], rpaks)
materials = list(chain.from_iterable(materials))
length = len(materials)
for index, material in enumerate(materials):
material.populateTextures(textureDict)
percent_complete(index, length, title="Linking textures")
test = list(filter(lambda x : x.header.name.endswith('00_gloss_flat_gls') == True, textures))
test