/// <summary> /// !! Hack.io.BMD Is required to use this !!<para/>Read in the Names of Bones from a model file. The file must have the same amount of bones as there are JointAnimations /// </summary> /// <param name="Model">The model to get the bone names from</param> public void LoadBoneNames(BMD.BMD Model) { if (JointAnimations.Count != Model.Joints.FlatSkeleton.Count) { throw new Exception("Number of Joints in the model doesn't match the number of Joint animations"); } for (int i = 0; i < Model.Joints.FlatSkeleton.Count; i++) { JointAnimations[i].JointName = Model.Joints.FlatSkeleton[i].Name; } }
public bool Open(BMD.BMD BMD, bool CopyOld2New) { try { names.Clear(); msg.Clear(); foreach (var NAME in BMD.name) { int Index = NAME.Index; byte[] OldNameSource = NAME.NameBytes; string NewName = ""; names.Add(new Names(Index, OldNameSource, NewName, NewCharList)); } foreach (var Message in BMD.msg) { int Index = Message.Index; string Type = Message.Type.ToString(); string Name = Message.Name; int CharacterNameIndex = Message.CharacterIndex; byte[] SourceBytes_str = Message.MsgBytes; MSG temp = new MSG(Index, Type, Name, CharacterNameIndex, SourceBytes_str) { CharacterIndex = CharacterNameIndex }; temp.Strings.ParseStrings(SourceBytes_str, NewCharList); msg.Add(temp); } if (CopyOld2New) { this.CopyOld2New(); } OpenFileName = Path.GetFileNameWithoutExtension(Path.GetFullPath(BMD.OpenFileName)) + ".PTP"; return(true); } catch (Exception e) { names.Clear(); msg.Clear(); OpenFileName = ""; Logging.Write("PTPfactory", e.ToString()); return(false); } }