public AtkdEditor(string atkdPath, ModelViewport mvp) { InitializeComponent(); filePath = atkdPath; atkd = new ATKD().Read(filePath); InitDataGridTable(); this.mvp = mvp; }
private void loadViewportButton_Click(object sender, EventArgs e) { // Compile the MTA just in case and load into the active viewport. mta = new MTA(); mta.Compile(new List <string>(richTextBox1.Text.Split('\n'))); ModelViewport modelViewport = (ModelViewport)MainForm.Instance.GetActiveModelViewport(); if (modelViewport != null) { modelViewport.CurrentMaterialAnimation = mta; } }
private void SnapShotMode(object sender, EventArgs e) { Control c = MainForm.Instance.GetActiveModelViewport(); if (!(c is ModelViewport)) { return; } ModelViewport view = (ModelViewport)c; view.currentMode = ModelViewport.Mode.Photoshoot; //view.HideAll(); if (((MenuItem)sender).GetContextMenu().SourceControl == stock_90_renderer) { view.shootWidth = 64; view.shootHeight = 64; } if (((MenuItem)sender).GetContextMenu().SourceControl == chr_00_renderer) { view.shootWidth = 128; view.shootHeight = 128; } if (((MenuItem)sender).GetContextMenu().SourceControl == chr_11_renderer) { view.shootWidth = 384; view.shootHeight = 384; } if (((MenuItem)sender).GetContextMenu().SourceControl == chr_13_renderer) { view.shootWidth = 416; view.shootHeight = 416; } Runtime.renderFloor = false; Runtime.renderBackGround = false; Runtime.renderBones = false; }
private void LetsDance(object sender, EventArgs e) { Control c = MainForm.Instance.GetActiveModelViewport(); if (!(c is ModelViewport)) { return; } ModelViewport view = (ModelViewport)c; view.currentMode = ModelViewport.Mode.Normal; NUT n = null; if (((MenuItem)sender).GetContextMenu().SourceControl == stock_90_renderer) { n = stock90; } if (((MenuItem)sender).GetContextMenu().SourceControl == chr_00_renderer) { n = chr00; } if (((MenuItem)sender).GetContextMenu().SourceControl == chr_11_renderer) { n = chr11; } if (((MenuItem)sender).GetContextMenu().SourceControl == chr_13_renderer) { n = chr13; } if (n == null) { return; } byte[] data = RenderTools.DXT5ScreenShot(view.glViewport, view.shootX, view.shootY, view.shootWidth, view.shootHeight); int id = n.Nodes.Count > 0 ? ((NutTexture)n.Nodes[0]).HashId : 0x280052B7; n.Nodes.Clear(); n.glTexByHashId.Clear(); NutTexture tex = new NutTexture(); tex.Width = view.shootWidth; tex.Height = view.shootHeight; tex.surfaces.Add(new TextureSurface()); tex.surfaces[0].mipmaps.Add(FlipDxt5(data, tex.Width, tex.Height)); tex.pixelInternalFormat = PixelInternalFormat.CompressedRgbaS3tcDxt5Ext; tex.HashId = id; n.Nodes.Add(tex); n.glTexByHashId.Add(tex.HashId, NUT.CreateTexture2D(tex)); ((MenuItem)sender).GetContextMenu().SourceControl.Invalidate(); if (((MenuItem)sender).GetContextMenu().SourceControl == stock_90_renderer) { if (stock90Loc != null) { stock90.Save(stock90Loc); } } if (((MenuItem)sender).GetContextMenu().SourceControl == chr_00_renderer) { if (chr00Loc != null) { chr00.Save(chr00Loc); } } if (((MenuItem)sender).GetContextMenu().SourceControl == chr_11_renderer) { if (chr11Loc != null) { chr11.Save(chr13Loc); } } if (((MenuItem)sender).GetContextMenu().SourceControl == chr_13_renderer) { if (chr13Loc != null) { chr13.Save(chr13Loc); } } }