Example #1
0
    void ExportViideoMotionKeyframes(XmlElement parent, VideoMotionKeyframes keyframes)
    {
        XmlElement elt = AddChild(parent, "Keyframes");

        elt.SetAttribute("Count", keyframes.Count.ToString(myNumberFormat));
        foreach (VideoMotionKeyframe keyframe in keyframes)
        {
            ExportVideoMotionKeyframe(elt, keyframe);
        }
    }
Example #2
0
    void ImportVideoMotionKeyframes(XmlElement parent, VideoMotionKeyframes keyframes)
    {
        XmlElement elt = parent["Keyframes"];

        if (null == elt)
        {
            return;
        }
        foreach (XmlElement child in elt.SelectNodes("VideoMotionKeyframe"))
        {
            ImportVideoMotionKeyframe(child, keyframes);
        }
    }
Example #3
0
    void ImportVideoMotionKeyframe(XmlElement parent, VideoMotionKeyframes keyframes)
    {
        Timecode            position = ChildTimecode(parent, "Position");
        VideoMotionKeyframe keyframe;

        if (position.Nanos == 0)
        {
            keyframe = (VideoMotionKeyframe)keyframes[0];
        }
        else
        {
            keyframe = new VideoMotionKeyframe(position);
            keyframes.Add(keyframe);
        }
        try { keyframe.Type = ChildVideoKeyframeType(parent, "Type"); } catch {}
        try { keyframe.Smoothness = ChildSingle(parent, "Smoothness"); } catch {}
        try { keyframe.Center = ChildVideoMotionVertex(parent, "Center"); } catch {}
        try { keyframe.Rotation = ChildDouble(parent, "Rotation"); } catch {}
        keyframe.Bounds = ChildVideoMotionBounds(parent, "Bounds");
    }