private void btnOK_Click(object sender, EventArgs e) { Model model = (SceneManager.Current.Models.Count > 0 ? SceneManager.Current.Models[modelIndex] : (Model)SceneManager.Current.Add(new Model())); newBoneKey = model.AddMesh(null, boneIndex); model.SetName(txtName.Text, newBoneKey); newBoneKey = ModelBone.GetModelBoneKey(modelIndex, newBoneKey); Close(); }
private void btnOK_Click(object sender, EventArgs e) { if (lstWheels.SelectedItem != null) { wheel = new Model(); WheelPreview wp = wheels[lstWheels.SelectedIndex]; CNTImporter cntImporter = new CNTImporter(); var rim = (Model)cntImporter.Import(Path.Combine(wp.Archive, wp.Path, "rim.cnt")); //var tyre = (Model)cntImporter.Import(wheelsFolder + lstWheels.SelectedItem + "\\tyre.cnt"); foreach (var mesh in rim.Meshes) { wheel.SetName(mesh.Name, wheel.AddMesh(mesh, 0)); } //foreach (var mesh in tyre.Meshes) { wheel.SetName(mesh.Name, wheel.AddMesh(mesh, 0)); } } this.Close(); }