Example #1
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            if (lstWheels.SelectedItem != null)
            {
                Wheel = new Model();

                Wheel       wp          = wheels[lstWheels.SelectedIndex];
                CNTImporter cntImporter = new CNTImporter();

                Model rim = (Model)cntImporter.Import(Path.Combine(wp.Archive, wp.Path, "rim.cnt"));

                foreach (ModelMesh mesh in rim.Meshes)
                {
                    Wheel.SetName(mesh.Name, Wheel.AddMesh(mesh, 0));
                }
            }

            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();
        }