public void AddModel(string internalPath, List <int> skins = null) { // adds mdl files and finds its dependencies string externalPath = FindExternalFile(internalPath); if (AddFile(internalPath, externalPath)) { mdlcount++; foreach (string reference in AssetUtils.findMdlRefs(internalPath)) { string ext_path = FindExternalFile(reference); AddFile(reference, FindExternalFile(reference)); if (reference.EndsWith(".phy")) { foreach (string gib in AssetUtils.findPhyGibs(ext_path)) { AddModel(gib); } } } var mdlMatsAndModels = AssetUtils.findMdlMaterialsAndModels(externalPath, skins); foreach (string mat in mdlMatsAndModels.Item1) { AddTexture(mat); } foreach (var model in mdlMatsAndModels.Item2) { AddModel(model); } } }
public void AddModel(string internalPath, List <int> skins = null) { // adds mdl files and finds its dependencies string externalPath = FindExternalFile(internalPath); if (AddFile(internalPath, externalPath)) { mdlcount++; foreach (string reference in AssetUtils.findMdlRefs(internalPath)) { string ext_path = FindExternalFile(reference); AddFile(reference, FindExternalFile(reference)); if (reference.EndsWith(".phy")) { foreach (string gib in AssetUtils.findPhyGibs(ext_path)) { AddModel(gib); } } } Tuple <List <string>, List <string> > mdlMatsAndModels; try { mdlMatsAndModels = AssetUtils.findMdlMaterialsAndModels(externalPath, skins); } catch (Exception e) { ExceptionHandler.LogException(e, false); CompilePalLogger.LogLineColor($"Failed to read file {externalPath}", Brushes.Red); return; } foreach (string mat in mdlMatsAndModels.Item1) { AddTexture(mat); } foreach (var model in mdlMatsAndModels.Item2) { AddModel(model); } } }
public void AddModel(string internalPath, List <int> skins = null) { // adds mdl files and finds its dependencies string externalPath = FindExternalFile(internalPath); if (AddFile(internalPath, externalPath)) { mdlcount++; foreach (string reference in AssetUtils.findMdlRefs(internalPath)) { AddFile(reference, FindExternalFile(reference)); } foreach (string mat in AssetUtils.findMdlMaterials(externalPath, skins)) { AddTexture(mat); } } }