public void LoadMesh(byte[] sha1res, byte[] sha1ebx, string path) { rtb2.Text = ""; currPath = path; tv3.Nodes.Clear(); rawResBuffer = main.Host.getDataBySha1(sha1res); rawEbxBuffer = main.Host.getDataBySha1(sha1ebx); if (rawEbxBuffer == null || rawResBuffer == null) { return; } try { hb1.ByteProvider = new DynamicByteProvider(rawResBuffer); hb2.ByteProvider = new DynamicByteProvider(new byte[0]); mesh = new MeshAsset(new MemoryStream(rawResBuffer)); rtb2.Text = mesh.ToString(); toolStripComboBox1.Items.Clear(); for (int i = 0; i < mesh.lods.Count; i++) { toolStripComboBox1.Items.Add("LOD " + i); } if (mesh.lods.Count > 0) { toolStripComboBox1.SelectedIndex = 0; } ebxObject = new EBX(new MemoryStream(rawEbxBuffer)); tv3.Nodes.Add(ebxObject.ToNode()); } catch (Exception ex) { rtb2.Text = "ERROR!!!:\n" + ex.Message + "\n\n" + rtb2.Text; } }
private void DisplayEBX() { rtb1.Text = ebxObj.ToString(); rtb2.Text = ebxObj.PrintFieldDescriptors(); rtb3.Text = ebxObj.PrintTypeDescriptors(); rtb4.Text = ebxObj.PrintFields(); rtb5.Text = ebxObj.PrintArrays(); rtb6.Text = ebxObj.PrintStringTable(); tv3.Nodes.Clear(); tv3.Nodes.Add(ebxObj.ToNode()); }