public Dictionary <string, int> GetMaterialsList(string fileName) { Dictionary <string, ModelBase.MaterialDef> materials = new Dictionary <string, ModelBase.MaterialDef>(); string modelFormat = fileName.Substring(fileName.Length - 3, 3).ToLower(); switch (modelFormat) { case "obj": materials = new OBJLoader(fileName).GetModelMaterials(); break; case "dae": materials = new DAELoader(fileName).GetModelMaterials(); break; case "imd": materials = new NITROIntermediateModelDataLoader(fileName).GetModelMaterials(); break; default: materials = new OBJLoader(fileName).GetModelMaterials(); break; } Dictionary <string, int> matColTypes = new Dictionary <string, int>(); foreach (string key in materials.Keys) { matColTypes.Add(key, 0); } return(matColTypes); }
public static KCL ConvertIMDToKCL(NitroFile modelFile, string fileName, float scale, float faceSizeThreshold, Dictionary <string, int> matColTypes, bool save = true) { KCL importedModel = new KCL(modelFile); ModelBase loadedModel = new NITROIntermediateModelDataLoader(fileName).LoadModel(); importedModel = CallKCLWriter(modelFile, loadedModel, scale, faceSizeThreshold, matColTypes, save); return(importedModel); }
public static BMD ConvertIMDToBMD(ref NitroFile modelFile, string fileName, float scale, BMDExtraImportOptions extraOptions, bool save = true) { BMD importedModel = new BMD(modelFile); ModelBase loadedModel = new NITROIntermediateModelDataLoader(fileName).LoadModel(scale); importedModel = CallBMDWriter(ref modelFile, loadedModel, extraOptions, save); return(importedModel); }