public static void findBspPakDependencies(BSP bsp, string tempdir) { // Search the temp folder to find dependencies of files extracted from the pak file if (Directory.Exists("tmp")) { foreach (String file in Directory.EnumerateFiles("tmp", "*.vmt", SearchOption.AllDirectories)) { foreach (string material in AssetUtils.findVmtMaterials(new FileInfo(file).FullName)) { bsp.TextureList.Add(material); } } } }
public void AddTexture(string internalPath) { // adds vmt files and finds its dependencies string externalPath = FindExternalFile(internalPath); if (AddFile(internalPath, externalPath)) { vmtcount++; foreach (string vtf in AssetUtils.findVmtTextures(externalPath)) { AddFile(vtf, FindExternalFile(vtf)); } foreach (string vmt in AssetUtils.findVmtMaterials(externalPath)) { AddTexture(vmt); } } }