public StaticMesh(UDKObject udk, int Index) { MyIndex = Index; Owner = udk; ReadEnd = GetPropertyEnd(Index); byte[] buff = udk.Exports[Index].data; MemoryStream m = new MemoryStream((byte[])buff.Clone()); Read(m); }
public StaticMesh(UDKObject udk, int Index) { MyIndex = Index; Owner = udk; ReadEnd = GetPropertyEnd(Index); byte[] buff = udk.Exports[Index].data; File.WriteAllBytes("C:\\test.bin", buff); MemoryStream m = new MemoryStream(buff); Read(m); }
private void openPackageToolStripMenuItem_Click(object sender, EventArgs e) { OpenFileDialog d = new OpenFileDialog(); d.Filter = "*.u;*.upk;*.udk|*.u;*.upk;*.udk"; if (d.ShowDialog() == System.Windows.Forms.DialogResult.OK) { udk = new UDKObject(d.FileName); RefreshList(); } }
public StaticMesh(UDKObject udk, int Index) { MyIndex = Index; Owner = udk; int start = GetPropertyEnd(Index); byte[] buff = new byte[udk.Exports[Index].data.Length - start]; for (int i = 0; i < udk.Exports[Index].data.Length - start; i++) buff[i] = udk.Exports[Index].data[i + start]; MemoryStream m = new MemoryStream(buff); SerializingContainer Container = new SerializingContainer(m); Container.isLoading = true; Serialize(Container); }
private void openToolStripMenuItem_Click(object sender, EventArgs e) { OpenFileDialog d = new OpenFileDialog(); d.Filter = "*.u;*.upk;*.udk|*.u;*.upk;*.udk"; if (d.ShowDialog() == System.Windows.Forms.DialogResult.OK) { udk = new UDKObject(d.FileName); RefreshLists(); RefreshClasses(); CurrentFile = d.FileName; Status.Text = "File: " + CurrentFile; } }
//private int ReadEnd; public SkeletalMesh(UDKObject udk, int Index) { MyIndex = Index; Owner = udk; int start = GetPropertyEnd(Index); byte[] buff = new byte[udk.Exports[Index].data.Length - start]; for (int i = 0; i < udk.Exports[Index].data.Length - start; i++) { buff[i] = udk.Exports[Index].data[i + start]; } MemoryStream m = new MemoryStream(buff); SerializingContainer Container = new SerializingContainer(m); Container.isLoading = true; Serialize(Container); }
public void ConvertPccToUpk(string filename) { string waitline = "\\-/|"; int pos = 0; int count = 0; BitConverter.IsLittleEndian = true; PCCObject pcc = new PCCObject(filename); string newfilename = Path.GetDirectoryName(filename) + "\\" + Path.GetFileNameWithoutExtension(filename) + ".upk"; UDKObject udk = new UDKObject(); udk.Names = new List <UDKObject.NameEntry>(); udk.Imports = new List <UDKObject.ImportEntry>(); udk.Exports = new List <UDKObject.ExportEntry>(); udk.ExportCount = pcc.Exports.Count; udk.ImportCount = pcc.Imports.Count; udk.NameCount = pcc.Names.Count; rtb1.Text = "Convert Names...\n"; RtbUpd(); foreach (string s in pcc.Names) { UDKObject.NameEntry e = new UDKObject.NameEntry(); e.name = s; e.flags = 0x70010; udk.Names.Add(e); if ((count++) % 100 == 0) { this.Text = "UDK Converter " + waitline[pos++]; if (pos == waitline.Length) { pos = 0; } } } rtb1.Text += "Convert Imports...\n"; RtbUpd(); foreach (PCCObject.ImportEntry i in pcc.Imports) { UDKObject.ImportEntry e = new UDKObject.ImportEntry(); e.raw = i.data; udk.Imports.Add(e); if ((count++) % 100 == 0) { this.Text = "UDK Converter " + waitline[pos++]; if (pos == waitline.Length) { pos = 0; } } } rtb1.Text += "Convert Exports...\n"; RtbUpd(); foreach (PCCObject.ExportEntry ex in pcc.Exports) { UDKObject.ExportEntry e = new UDKObject.ExportEntry(); e.raw = ex.info; e.data = ex.Data; udk.Exports.Add(e); if ((count++) % 100 == 0) { this.Text = "UDK Converter " + waitline[pos++]; if (pos == waitline.Length) { pos = 0; } } } rtb1.Text += "Saving to file...\n"; this.Text = "UDK Converter"; udk._HeaderOff = 0x19; udk.Header = CreateUPKHeader(pcc); udk.fz.raw = new byte[0]; udk.SaveToFile(newfilename); MessageBox.Show("Done."); }