Exemplo n.º 1
0
 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);
 }
Exemplo n.º 2
0
        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
            });
        }
Exemplo n.º 3
0
        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);
            }
        }