public bool TryGetNodeByName(string Name, out IOAnimNode Node) { Node = null; foreach (IOAnimNode node in Nodes) { if (node.Name.Equals(Name)) { Node = node; return(true); } } return(false); }
public void AddKey(string BoneName, IOTrackType TrackType, float Frame, float Value, IOInterpolationType InterpolationType = IOInterpolationType.Linear, float In = 0, float Out = 0) { IOAnimNode Node = null; if (!TryGetNodeByName(BoneName, out Node)) { Node = new IOAnimNode(BoneName); Nodes.Add(Node); } Node.AddKey(TrackType, new IOAnimKey() { Frame = Frame, Value = Value, InterpolationType = InterpolationType, In = In, Out = Out }); }
private static void AddAnimData(AnimBone animBone, IOAnimNode node, IOTrackType type, ControlType ctype, TrackType ttype) { AnimData d = new AnimData(); d.controlType = ctype; d.type = ttype; foreach (IOAnimKey key in node.GetKeysForTrack(type)) { AnimKey animKey = new AnimKey() { input = key.Frame + 1, output = key.Value, }; d.keys.Add(animKey); } if (d.keys.Count > 0) { animBone.atts.Add(d); } }