/// <summary> /// /// </summary> /// <returns></returns> private MEXCostume GenerateCostume() { var costume = new MEXCostume() { Costume = new HSDRaw.MEX.MEX_CostumeFileSymbol() }; using (var bmp = new Bitmap(24, 24)) costume.FromImage(bmp); return(costume); }
/// <summary> /// /// </summary> /// <param name="datFile"></param> /// <param name="stc"></param> /// <param name="csp"></param> /// <returns></returns> private MEXCostume ToCostume(string fileName, HSDRawFile file, HSD_TOBJ stc, HSD_TOBJ csp) { // create blank stock icon if one isn't set if (stc == null) { using (var bmp = new Bitmap(24, 24)) stc = bmp.ToTOBJ(HSDRaw.GX.GXTexFmt.CI4, HSDRaw.GX.GXTlutFmt.IA8); } // var costume = new MEXCostume() { Costume = new HSDRaw.MEX.MEX_CostumeFileSymbol() { FileName = Path.GetFileName(fileName) }, Icon = stc, CSP = csp }; // detect roots foreach (var r in file.Roots) { if (r.Name.EndsWith("_matanim_joint")) { costume.MaterialSymbol = r.Name; } else if (r.Name.EndsWith("_joint")) { costume.ModelSymbol = r.Name; } } return(costume); }