public ExpressionGroup(JSONClass groupJSON, DollmasterPlugin dm) { this.dm = dm; groupJSON.Keys.ToList().ForEach((string key) => { string name = PathExt.GetFileNameWithoutExtension(key); JSONClass node = KeyToJSON(key, groupJSON[key]); nameToJSON[name] = node; }); }
public Montage(Atom atom, string filePath) { this.atom = atom; montageJSON = JSON.Parse(SuperController.singleton.ReadFileIntoString(filePath)) as JSONClass; poses.Add(ExtractPersonPose(montageJSON)); string fileName = PathExt.GetFileName(filePath); string folder = filePath.Replace(fileName, ""); string montageName = PathExt.GetFileNameWithoutExtension(filePath); name = montageName; List <string> poseFiles = SuperController.singleton.GetFilesAtPath(folder, "*.json").ToList().Where(path => { if (path.Contains(montageName) == false) { return(false); } int periodCount = path.Count(f => f == '.'); if (periodCount <= 1) { return(false); } return(true); }).ToList(); poseFiles.ForEach(poseFilePath => { //Debug.Log("pose file found" + poseFilePath); var poseMontageJSON = JSON.Parse(SuperController.singleton.ReadFileIntoString(poseFilePath)) as JSONClass; poses.Add(ExtractPersonPose(poseMontageJSON)); }); //Debug.Log("montage " + filePath + " has " + poses.Count() + " poses"); }