private void llTxt_LinkClicked(object sender, System.Windows.Forms.LinkLabelLinkClickedEventArgs e) { AnimationMeshBlock ab1 = (AnimationMeshBlock)tv.SelectedNode.Tag; SaveFileDialog ofd = new SaveFileDialog(); ofd.Filter = "TextFile (*.txt)|*.txt|All Files (*.*)|*.*"; if (ofd.ShowDialog() == DialogResult.OK) { System.IO.StreamWriter sw = System.IO.File.CreateText(ofd.FileName); try { sw.WriteLine(ab1.Name + "-----------------------------------"); foreach (AnimationFrameBlock ab2 in ab1.Part2) { sw.WriteLine("--------------- " + ab2.ToString() + " ---------------"); foreach (AnimationAxisTransformBlock aatb in ab2.AxisSet) { sw.WriteLine(" " + aatb.ToString() + ":"); foreach (AnimationAxisTransform aat in aatb) { sw.WriteLine(" " + aat.ToString()); } } } } finally { sw.Close(); sw.Dispose(); sw = null; } } }
public AnimationFrameBlock(AnimationMeshBlock parent) { this.parent = parent; datai = new uint[6]; datai[0] = 297403888; datai[1] = 297403888; datai[3] = 297403888; datai[5] = 297403888; this.Unknown5Bits = 15; ab3 = new AnimationAxisTransformBlock[0]; this.TransformationType = FrameType.Unknown; }
/// <summary> /// Tries to find a <see cref="AnimationFrameBlock"/> with the same Name in the passed <see cref="AnimationMeshBlock" />. /// </summary> public void FindTarget(AnimationMeshBlock amb) { action = AnimImporterAction.Nothing; foreach (AnimationFrameBlock afb in amb.Part2) { if (afb.Name == ImportedName) { action = AnimImporterAction.Replace; target = afb; break; } } }
/// <summary> /// Add the <see cref="FrameBlock"/> to the passed <see cref="AnimationMeshBlock"/>. /// </summary> public void AddFrameBlock(AnimationMeshBlock amb) { if (amb == null) { return; } amb.Part2 = (AnimationFrameBlock[])Helper.Add(amb.Part2, FrameBlock); if (ruf) { FrameBlock.RemoveUnneededFrames(); } FrameBlock.Duration = FrameBlock.GetDuration(); }
protected void RefreshData(AnimationMeshBlock amb) { ClearJoint(); if (amb != null) { foreach (AnimationFrameBlock afb in amb.Part2) { cbJoint.Items.Add(afb); } if (cbJoint.Items.Count > 0) { cbJoint.SelectedIndex = 0; } } }
private void miRem_Click(object sender, System.EventArgs e) { AnimationMeshBlock ab1 = (AnimationMeshBlock)cbSubMesh.SelectedItem; AnimationFrameBlock afb = (AnimationFrameBlock)cbJoint.SelectedItem; if (ab1 != null && afb != null) { ab1.Part2 = (AnimationFrameBlock[])Helper.Delete(ab1.Part2, afb); int sel = cbJoint.SelectedIndex + 1; if (sel >= cbJoint.Items.Count) { sel = cbJoint.Items.Count - 1; } cbJoint.Items.Remove(afb); cbJoint.SelectedIndex = sel; } }
private void llExport_LinkClicked(object sender, System.Windows.Forms.LinkLabelLinkClickedEventArgs e) { AnimationMeshBlock ab1 = (AnimationMeshBlock)cbSubMesh.SelectedItem; GenericRcol gmdc = ab1.FindUsedGMDC(ab1.FindDefiningCRES()); if (gmdc != null) { GeometryDataContainer gdc = (GeometryDataContainer)gmdc.Blocks[0]; gdc.LinkedAnimation = ab1; fGeometryDataContainer.StartExport(new System.Windows.Forms.SaveFileDialog(), gdc, ".txt", gdc.Groups, (SimPe.Plugin.Gmdc.ElementSorting)fGeometryDataContainer.DefaultSelectedAxisIndex, this.cbCorrect.Checked); } else { Helper.ExceptionMessage(new Warning("Unable to Find Model File for \"" + ab1.Name + "\".", "SimPe was not able to Find the Model File that defines the specified Hirarchy. The Animation will not get exported!")); } }
private void miAdd_Click(object sender, System.EventArgs e) { AnimationMeshBlock ab1 = (AnimationMeshBlock)cbSubMesh.SelectedItem; if (ab1 != null) { AnimationFrameBlock afb = new AnimationFrameBlock(ab1); afb.Name = "SimPE Dummy"; afb.TransformationType = FrameType.Rotation; afb.CreateBaseAxisSet(); ab1.Part2 = (AnimationFrameBlock[])Helper.Add(ab1.Part2, afb); cbJoint.SelectedIndex = -1; cbJoint.Items.Add(afb); cbJoint.SelectedIndex = cbJoint.Items.Count - 1; } }
public void UnserializeData(System.IO.BinaryReader reader) { unknown1 = reader.ReadInt16(); short ct1 = reader.ReadInt16(); short ct2 = reader.ReadInt16(); headerb = reader.ReadBytes(headerb.Length); for (int i = 0; i < headeri.Length; i++) { headeri[i] = reader.ReadUInt32(); } for (int i = 0; i < headerf.Length; i++) { headerf[i] = reader.ReadSingle(); } objname = Helper.ToString(reader.ReadBytes(headerb[5])); reader.ReadByte(); //read the terminating 0 objmod = Helper.ToString(reader.ReadBytes(headerb[0])); reader.ReadByte(); //read the terminating 0 int ct = headerb[0] + headerb[5]; Align(reader, ct + 2); //--- part1 --- ab1 = new AnimationMeshBlock[ct1]; int len = 0; for (int i = 0; i < ab1.Length; i++) { ab1[i] = new AnimationMeshBlock(this.Parent); ab1[i].UnserializeData(reader); } for (int i = 0; i < ab1.Length; i++) { len += ab1[i].UnserializeName(reader); } Align(reader, len); //--- part2 --- len = 0; for (int i = 0; i < ab1.Length; i++) { ab1[i].UnserializePart2Data(reader); } for (int i = 0; i < ab1.Length; i++) { len += ab1[i].UnserializePart2Name(reader); } Align(reader, len); try { //--- part3 --- for (int i = 0; i < ab1.Length; i++) { ab1[i].UnserializePart3Data(reader); } for (int i = 0; i < ab1.Length; i++) { ab1[i].UnserializePart3AddonData(reader); } //--- part4 --- for (int i = 0; i < ab1.Length; i++) { ab1[i].UnserializePart4Data(reader); } //--- part5 --- for (int i = 0; i < ab1.Length; i++) { ab1[i].UnserializePart5Data(reader); } //--- part6 --- ab6 = new AnimBlock6[ct2]; len = 0; for (int i = 0; i < ab6.Length; i++) { ab6[i] = new AnimBlock6(); ab6[i].UnserializeData(reader); } for (int i = 0; i < ab6.Length; i++) { len += ab6[i].UnserializeName(reader); } } catch {} unknowndata = reader.ReadBytes((int)(reader.BaseStream.Length - reader.BaseStream.Position)); }