public void LoadStaticMesh(string pkg, string file) { try { using (NexusEngineExtension.NWaitCursor wc = new NexusEngineExtension.NWaitCursor(this)) { NResourceLoc resLoc = new NResourceLoc(pkg, file); m_resStaticMesh = NResourceManager.Instance.LoadStaticMesh( resLoc, EResourceIOMode.Block, EResourceIOPriority.Normal ); m_prop = new ResStaticMeshProperty(m_resStaticMesh); this.propertyGridRes.SelectedObject = m_prop; m_preview.ShowStaticMesh(m_resStaticMesh); RefreshLOD(); } } catch (System.Exception ex) { NexusEditor.Program.ShowException(ex, "Load Static Mesh FAILED"); } }
private bool ResetResource(string confirmTxt) { if (m_resStaticMesh != null && confirmTxt.Length > 0) { if (DialogResult.OK != MessageBox.Show(this, confirmTxt, "Please Confirm", MessageBoxButtons.OKCancel)) { return(false); } } //-- m_preview.Reset(); if (m_resStaticMesh != null) { m_resStaticMesh.Dispose(); m_resStaticMesh = null; } m_prop = null; this.propertyGridMtl.SelectedObject = null; this.propertyGridRes.SelectedObject = null; this.comboBoxLOD.Items.Clear(); this.comboBoxSection.Items.Clear(); return(true); }
private void CreateResource() { ResetResource(""); // 产生一个不重复的名称 string resName = "NewStaticMesh"; resName += DateTime.Now.ToFileTime(); // 创建空白资源和内部数据 m_resStaticMesh = NResourceManager.Instance.NewStaticMesh(resName); m_prop = new ResStaticMeshProperty(m_resStaticMesh); // 更新界面 RefreshLOD(); m_preview.ShowStaticMesh(m_resStaticMesh); }