public void CalculateNormals(object[] editors, object[] numMeshes, object[] meshes, double threshold) { if (editors == null || numMeshes == null || meshes == null) { return; } List <xxSubmesh> submeshList = new List <xxSubmesh>(meshes.Length); xxEditor editor = null; int editorIdx = -1; int i = 1; foreach (object id in meshes) { if (--i == 0) { editorIdx++; i = (int)(double)numMeshes[editorIdx]; editor = (xxEditor)editors[editorIdx]; } submeshList.AddRange(editor.Meshes[(int)(double)id].Mesh.SubmeshList); } xx.CalculateNormals(submeshList, (float)threshold); Changed = true; }
public FormXXDragDrop(xxEditor destEditor) { InitializeComponent(); startSize = new SizeF(Width, Height); this.SaveDesignSizes(); editor = destEditor; numericFrameId.Maximum = editor.Frames.Count - 1; numericMeshId.Maximum = editor.Frames.Count - 1; }
public FormXXEditHex(FormXX formXX, List <int[]> gotoCells) { InitializeComponent(); this.Text += " of " + formXX.ToolTipText; this.formXX = formXX; this.editor = formXX.Editor; this.parser = editor.Parser; this.gotoCells = gotoCells; foreach (TabPage page in tabControl1.TabPages) { foreach (Control control in page.Controls) { if (control is DataGridViewEditor) { page.Tag = control; break; } } } xxTable.BeginLoadData(); frameTable.BeginLoadData(); meshTable.BeginLoadData(); submeshTable.BeginLoadData(); materialTable.BeginLoadData(); textureTable.BeginLoadData(); InitColumns(); InitTables(); xxTable.EndLoadData(); xxTable.AcceptChanges(); frameTable.EndLoadData(); frameTable.AcceptChanges(); meshTable.EndLoadData(); meshTable.AcceptChanges(); submeshTable.EndLoadData(); submeshTable.AcceptChanges(); materialTable.EndLoadData(); materialTable.AcceptChanges(); textureTable.EndLoadData(); textureTable.AcceptChanges(); this.KeyDown += new KeyEventHandler(FormXXEditHex_KeyDown); this.Load += new EventHandler(FormXXEditHex_Load); }
public FormXXEditHex(FormXX formXX, List<int[]> gotoCells) { InitializeComponent(); this.Text += " of " + formXX.ToolTipText; this.formXX = formXX; this.editor = formXX.Editor; this.parser = editor.Parser; this.gotoCells = gotoCells; foreach (TabPage page in tabControl1.TabPages) { foreach (Control control in page.Controls) { if (control is DataGridViewEditor) { page.Tag = control; break; } } } xxTable.BeginLoadData(); frameTable.BeginLoadData(); meshTable.BeginLoadData(); submeshTable.BeginLoadData(); materialTable.BeginLoadData(); textureTable.BeginLoadData(); InitColumns(); InitTables(); xxTable.EndLoadData(); xxTable.AcceptChanges(); frameTable.EndLoadData(); frameTable.AcceptChanges(); meshTable.EndLoadData(); meshTable.AcceptChanges(); submeshTable.EndLoadData(); submeshTable.AcceptChanges(); materialTable.EndLoadData(); materialTable.AcceptChanges(); textureTable.EndLoadData(); textureTable.AcceptChanges(); this.KeyDown += new KeyEventHandler(FormXXEditHex_KeyDown); this.Load += new EventHandler(FormXXEditHex_Load); }
public FormXXDragDrop(xxEditor destEditor, bool frame) { InitializeComponent(); editor = destEditor; if (frame) { panelFrame.BringToFront(); } else { panelMesh.BringToFront(); } numericFrameId.Maximum = editor.Frames.Count - 1; numericMeshId.Maximum = editor.Frames.Count - 1; }
public void SnapBorders(object[] editors, object[] numMeshes, object[] meshes, int targetMesh, object[] targetSubmeshes, double tolerance, bool position, bool normal, bool bonesAndWeights, bool uv) { List <xxMesh> srcMeshes = new List <xxMesh>(); xxMesh mesh = Meshes[targetMesh].Mesh; List <xxSubmesh> submeshList = new List <xxSubmesh>(targetSubmeshes != null ? targetSubmeshes.Length : mesh.SubmeshList.Count); if (editors != null && numMeshes != null && meshes != null) { srcMeshes.Capacity = meshes.Length; xxEditor editor = null; int editorIdx = -1; int i = 1; foreach (object id in meshes) { if (--i == 0) { editorIdx++; i = (int)(double)numMeshes[editorIdx]; editor = (xxEditor)editors[editorIdx]; } srcMeshes.Add(editor.Meshes[(int)(double)id].Mesh); } if (targetSubmeshes != null) { foreach (object id in targetSubmeshes) { submeshList.Add(mesh.SubmeshList[(int)(double)id]); } } else { submeshList.AddRange(mesh.SubmeshList); } xx.SnapBorders(srcMeshes, mesh, submeshList, (float)tolerance, position, normal, bonesAndWeights, uv); } else { Report.ReportLog("Snapping inside of one mesh not implemented yet."); return; } }