// Fbx could have been exported any which way so still need to do try all mappings to find correct public bool ParseMorph(BinaryReader br, string id) { MegaMorphOMatic mr = (MegaMorphOMatic)target; switch (id) { case "Max": mr.Max = br.ReadSingle(); break; case "Min": mr.Min = br.ReadSingle(); break; case "UseLim": mr.UseLimit = (br.ReadInt32() == 1); break; // This will only be changed points, but we need scale case "StartPoints": // Mapping MegaTargetMesh tm = new MegaTargetMesh(); tm.verts = MegaParse.ReadP3l(br); // make a vector if (!TryMapping1(tm, mr)) { EditorUtility.DisplayDialog("Mapping Failed!", "Mapping failed!", "OK"); EditorUtility.ClearProgressBar(); return(false); } break; case "Channel": mr.chanBank.Add(LoadChan(br)); break; case "Animation": LoadAnimation(mr, br); break; default: return(false); } return(true); }
// Fbx could have been exported any which way so still need to do try all mappings to find correct public bool ParseMorph(BinaryReader br, string id) { MegaMorph mr = (MegaMorph)target; //Debug.Log("ParseMorph " + id); switch (id) { case "Max": mr.Max = br.ReadSingle(); break; case "Min": mr.Min = br.ReadSingle(); break; case "UseLim": mr.UseLimit = (br.ReadInt32() == 1); break; case "StartPoints": // Mapping MegaTargetMesh tm = new MegaTargetMesh(); tm.verts = MegaParse.ReadP3l(br); // make a vector //Debug.Log("num " + tm.verts.Count); if (!TryMapping1(tm, mr)) { EditorUtility.DisplayDialog("Mapping Failed!", "Mapping failed! Please check the Morph page on the MegaFiers website for reasons for this", "OK"); EditorUtility.ClearProgressBar(); return(false); } //Debug.Log("StartPoints " + tm.verts.Count); break; case "Channel": mr.chanBank.Add(LoadChan(br)); break; case "Animation": LoadAnimation(mr, br); break; default: return(false); } return(true); }