internal unsafe void PercentChanged(object sender, EventArgs e) { if (SelectedSource == null || SelectedDestination == null || updating) { return; } if ((SelectedAnimation != null) && (CurrentFrame >= 1)) { SHP0EntryNode entry = SelectedAnimation.FindChild(SelectedSource, false) as SHP0EntryNode; SHP0VertexSetNode v; if (entry == null) { (v = (entry = SelectedAnimation.FindOrCreateEntry(SelectedSource)).Children[0] as SHP0VertexSetNode).Name = SelectedDestination; } else if ((v = entry.FindChild(SelectedDestination, false) as SHP0VertexSetNode) == null) { if (!float.IsNaN(textBox1.Value)) { v = entry.FindOrCreateEntry(SelectedDestination); v.SetKeyframe(CurrentFrame - 1, textBox1.Value / 100.0f); } } else if (float.IsNaN(textBox1.Value)) { v.RemoveKeyframe(CurrentFrame - 1); } else { v.SetKeyframe(CurrentFrame - 1, textBox1.Value / 100.0f); } if (_mainWindow.InterpolationEditor != null && _mainWindow.InterpolationEditor._targetNode != VertexSetDest) { _mainWindow.InterpolationEditor.SetTarget(VertexSetDest); } } ResetBox(); _mainWindow.KeyframePanel.UpdateKeyframe(CurrentFrame - 1); _mainWindow.UpdateModel(); }
internal unsafe void PercentChanged(object sender, EventArgs e) { if (VertexSet == null || SelectedDestination == null || updating) { return; } MDL0VertexNode vSet = VertexSet; if ((SelectedAnimation != null) && (CurrentFrame > 0)) { SHP0EntryNode entry = SelectedAnimation.FindChild(vSet.Name, false) as SHP0EntryNode; SHP0VertexSetNode v; if (entry == null) { (v = (entry = SelectedAnimation.FindOrCreateEntry(vSet.Name)).Children[0] as SHP0VertexSetNode).Name = SelectedDestination.Name; } else if ((v = entry.FindChild(SelectedDestination.Name, false) as SHP0VertexSetNode) == null) { if (!float.IsNaN(textBox1.Value)) { v = entry.FindOrCreateEntry(SelectedDestination.Name); v.SetKeyframe(CurrentFrame - 1, textBox1.Value / 100.0f); } } else if (float.IsNaN(textBox1.Value)) { v.RemoveKeyframe(CurrentFrame - 1); } else { v.SetKeyframe(CurrentFrame - 1, textBox1.Value / 100.0f); } } //TargetModel.ApplyCHR(SelectedCHR0, CurrentFrame); //TargetModel.ApplySHP(SelectedAnimation, CurrentFrame); //ResetBox(); //_mainWindow.modelPanel1.Invalidate(); _mainWindow.UpdateModel(); }