Przeglądaj źródła

Added missing animation documentation

BearishSun 9 lat temu
rodzic
commit
1f5425aa69

+ 4 - 0
Source/MBansheeEditor/Windows/Animation/FieldSelectionWindow.cs

@@ -10,6 +10,10 @@ namespace BansheeEditor
      *  @{
      */
 
+    /// <summary>
+    /// Opens up a window that allows the user to select a field to animate using the animation editor. 
+    /// See <see cref="GUIFieldSelector"/>.
+    /// </summary>
     [DefaultSize(250, 350)]
     internal class FieldSelectionWindow : DropDownWindow
     {

+ 174 - 4
Source/MBansheeEditor/Windows/Animation/GUIAnimFieldDisplay.cs

@@ -8,9 +8,13 @@ using BansheeEngine;
 namespace BansheeEditor
 {
     /** @addtogroup AnimationEditor
-     *  @{
-     */
+      *  @{
+      */
 
+    /// <summary>
+    /// Renders a hierarchical list of animation curve fields and displays information about them. Also allows field 
+    /// selection.
+    /// </summary>
     internal class GUIAnimFieldDisplay
     {
         private SceneObject root;
@@ -23,6 +27,19 @@ namespace BansheeEditor
         private GUIAnimFieldEntry[] fields;
         private GUIAnimFieldLayouts layouts;
 
+        /// <summary>
+        /// Triggered when the user clicks on an new entry in the field display. Curve field path of the selected entry
+        /// is provided.
+        /// </summary>
+        public Action<string> OnEntrySelected;
+
+        /// <summary>
+        /// Creates a new animation field display GUI element and adds it to the provided layout.
+        /// </summary>
+        /// <param name="layout">Layout to add the GUI element to.</param>
+        /// <param name="width">Width of the GUI element, in pixels.</param>
+        /// <param name="height">Height of the GUI element, in pixels.</param>
+        /// <param name="root">Scene object that the root curve field paths reference.</param>
         public GUIAnimFieldDisplay(GUILayout layout, int width, int height, SceneObject root)
         {
             this.root = root;
@@ -33,8 +50,11 @@ namespace BansheeEditor
             SetSize(width, height);
         }
 
-        public Action<string> OnEntrySelected;
-
+        /// <summary>
+        /// Changes the size of the GUI element.
+        /// </summary>
+        /// <param name="width">Width of the GUI element, in pixels.</param>
+        /// <param name="height">Height of the GUI element, in pixels.</param>
         public void SetSize(int width, int height)
         {
             this.width = width;
@@ -46,6 +66,10 @@ namespace BansheeEditor
             Rebuild();
         }
 
+        /// <summary>
+        /// Sets which fields to display.
+        /// </summary>
+        /// <param name="fields">A list of fields to display.</param>
         public void SetFields(AnimFieldInfo[] fields)
         {
             this.fieldInfos.Clear();
@@ -54,6 +78,10 @@ namespace BansheeEditor
             Rebuild();
         }
 
+        /// <summary>
+        /// Adds a new field to the existing field list, and displays it.
+        /// </summary>
+        /// <param name="field">Field to append to the field list, and display.</param>
         public void AddField(AnimFieldInfo field)
         {
             bool exists = fieldInfos.Exists(x =>
@@ -68,6 +96,10 @@ namespace BansheeEditor
             }
         }
 
+        /// <summary>
+        /// Changes the displayed values for each field.
+        /// </summary>
+        /// <param name="values">Values to assign to the fields. Must match the number of displayed fields. </param>
         public void SetDisplayValues(GUIAnimFieldPathValue[] values)
         {
             for (int i = 0; i < fields.Length; i++)
@@ -82,6 +114,10 @@ namespace BansheeEditor
             }
         }
 
+        /// <summary>
+        /// Sets which fields should be displayed as selected.
+        /// </summary>
+        /// <param name="paths">Curve field paths of fields to display as selected.</param>
         public void SetSelection(string[] paths)
         {
             Action<GUIAnimFieldEntry> updateSelection = field =>
@@ -115,6 +151,9 @@ namespace BansheeEditor
             }
         }
 
+        /// <summary>
+        /// Rebuilds the entire GUI based on the current field list and their properties.
+        /// </summary>
         private void Rebuild()
         {
             scrollArea.Layout.Clear();
@@ -235,6 +274,9 @@ namespace BansheeEditor
         }
     }
 
+    /// <summary>
+    /// All layouts used for placing field display GUI elements.
+    /// </summary>
     internal class GUIAnimFieldLayouts
     {
         public GUILayout main;
@@ -243,12 +285,18 @@ namespace BansheeEditor
         public GUILayout background;
     }
 
+    /// <summary>
+    /// Path/value combination used for representing the value of the currently selected frame for a specific curve path.
+    /// </summary>
     internal struct GUIAnimFieldPathValue
     {
         public string path;
         public object value;
     }
 
+    /// <summary>
+    /// Base class for individual entries in a GUI animation curve field display.
+    /// </summary>
     internal abstract class GUIAnimFieldEntry
     {
         private const int MAX_PATH_LENGTH = 30;
@@ -260,10 +308,23 @@ namespace BansheeEditor
 
         private int entryHeight;
 
+        /// <summary>
+        /// Triggered when the user selects this entry. Curve field path of the selected entry is provided.
+        /// </summary>
         public Action<string> OnEntrySelected;
 
+        /// <summary>
+        /// Path of the curve field path this entry represents.
+        /// </summary>
         public string Path { get { return path; } }
 
+        /// <summary>
+        /// Constructs a new animation field entry and appends the necessary GUI elements to the provided layouts.
+        /// </summary>
+        /// <param name="layouts">Layouts to append the GUI elements to.</param>
+        /// <param name="path">Path of the curve field.</param>
+        /// <param name="child">Determines if the element is a root path, or a child (sub) element.</param>
+        /// <param name="indentAmount">Determines how much to horizontally indent the element, in pixels.</param>
         public GUIAnimFieldEntry(GUIAnimFieldLayouts layouts, string path, bool child, int indentAmount)
         {
             this.path = path;
@@ -289,12 +350,20 @@ namespace BansheeEditor
             layouts.background.AddElement(backgroundTexture);
         }
 
+        /// <summary>
+        /// Hides or shows the element.
+        /// </summary>
+        /// <param name="on">True to show the element, false otherwise.</param>
         public virtual void Toggle(bool on)
         {
             selectionBtn.Active = on;
             backgroundTexture.Active = on;
         }
 
+        /// <summary>
+        /// Toggles whether the entry is displayed as selected, or not selected.
+        /// </summary>
+        /// <param name="selected">True to display as selected, false otherwise.</param>
         public void SetSelection(bool selected)
         {
             if(selected)
@@ -303,18 +372,36 @@ namespace BansheeEditor
                 backgroundTexture.SetTint(Color.Transparent);
         }
 
+        /// <summary>
+        /// Changes the displayed value next to the element's name.
+        /// </summary>
+        /// <param name="value"></param>
         public virtual void SetValue(object value) { }
 
+        /// <summary>
+        /// Returns all child elements, if this element is complex and has children (e.g. vector).
+        /// </summary>
+        /// <returns>List of child elements, or null if none.</returns>
         public virtual GUIAnimFieldEntry[] GetChildren()
         {
             return null;
         }
 
+        /// <summary>
+        /// Returns the height of this element.
+        /// </summary>
+        /// <returns>Height of this element, in pixels.</returns>
         protected int GetEntryHeight()
         {
             return entryHeight;
         }
 
+        /// <summary>
+        /// Generates a name to display on the element's GUI based on its path.
+        /// </summary>
+        /// <param name="path">Path of the curve field.</param>
+        /// <param name="shortName">True to generate a short path without scene object or component info.</param>
+        /// <returns>Text to display on the element's GUI.</returns>
         protected static string GetDisplayName(string path, bool shortName)
         {
             if (string.IsNullOrEmpty(path))
@@ -357,6 +444,17 @@ namespace BansheeEditor
             }
         }
 
+        /// <summary>
+        /// Parses a curve field path and breaks it down relevant components.
+        /// </summary>
+        /// <param name="path">Curve field path to parse.</param>
+        /// <param name="shortName">If true, only the last entry of the property portion of the path will be output in 
+        ///                         <paramref name="propertyPath"/>. Otherwise all properties will be output.</param>
+        /// <param name="soName">Name of the scene object the path field belongs to.</param>
+        /// <param name="compName">Name of the component the path field belongs to, if any.</param>
+        /// <param name="propertyPath">A list of properties relative to parent component or scene object, that determine
+        ///                            which field does the path reference. If <paramref name="shortName"/> is true, only
+        ///                            the last property will be output (if there are multiple).</param>
         protected static void GetNames(string path, bool shortName, out string soName, out string compName, out string propertyPath)
         {
             string[] entries = path.Split('/');
@@ -432,12 +530,22 @@ namespace BansheeEditor
         }
     }
 
+    /// <summary>
+    /// Creates GUI for an element in animation field display, that contains no child elements.
+    /// </summary>
     internal class GUIAnimSimpleEntry : GUIAnimFieldEntry
     {
         private GUILabel valueDisplay;
         private GUILayoutX underlayLayout;
         private GUILabel overlaySpacing;
 
+        /// <summary>
+        /// Constructs a new animation field entry and appends the necessary GUI elements to the provided layouts.
+        /// </summary>
+        /// <param name="layouts">Layouts to append the GUI elements to.</param>
+        /// <param name="path">Path of the curve field.</param>
+        /// <param name="color">Color of the path field curve, to display next to the element name.</param>
+        /// <param name="child">Determines if the element is a root path, or a child (sub) element.</param>
         public GUIAnimSimpleEntry(GUIAnimFieldLayouts layouts, string path, Color color, bool child = false)
             : base(layouts, path, child, child ? 45 : 30)
         {
@@ -458,6 +566,7 @@ namespace BansheeEditor
             layouts.overlay.AddElement(overlaySpacing);
         }
 
+        /// <inheritdoc/>
         public override void Toggle(bool on)
         {
             underlayLayout.Active = on;
@@ -466,6 +575,7 @@ namespace BansheeEditor
             base.Toggle(on);
         }
 
+        /// <inheritdoc/>
         public override void SetValue(object value)
         {
             if (value == null)
@@ -476,6 +586,9 @@ namespace BansheeEditor
         }
     }
 
+    /// <summary>
+    /// Base class for elements in animation field display, that contain other child elements.
+    /// </summary>
     internal class GUIAnimComplexEntry : GUIAnimFieldEntry
     {
         private GUILayout foldoutLayout;
@@ -484,6 +597,13 @@ namespace BansheeEditor
 
         protected GUIAnimSimpleEntry[] children;
 
+        /// <summary>
+        /// Constructs a new animation field entry and appends the necessary GUI elements to the provided layouts.
+        /// </summary>
+        /// <param name="layouts">Layouts to append the GUI elements to.</param>
+        /// <param name="path">Path of the curve field.</param>
+        /// <param name="childEntries">Sub-path names of the child entries to display.</param>
+        /// <param name="colors">Colors of the curves to display, for each child entry.</param>
         public GUIAnimComplexEntry(GUIAnimFieldLayouts layouts, string path, string[] childEntries, Color[] colors)
             : base(layouts, path, false, 20)
         {
@@ -518,24 +638,36 @@ namespace BansheeEditor
             Toggle(false);
         }
 
+        /// <inheritdoc/>
         public override void Toggle(bool on)
         {
             foreach(var child in children)
                 child.Toggle(on);
         }
 
+        /// <inheritdoc/>
         public override GUIAnimFieldEntry[] GetChildren()
         {
             return children;
         }
     }
 
+    /// <summary>
+    /// Creates a GUI for displaying a Vector2 curve field in the animation field display GUI element.
+    /// </summary>
     internal class GUIAnimVec2Entry : GUIAnimComplexEntry
     {
+        /// <summary>
+        /// Constructs a new animation field entry and appends the necessary GUI elements to the provided layouts.
+        /// </summary>
+        /// <param name="layouts">Layouts to append the GUI elements to.</param>
+        /// <param name="path">Path of the curve field.</param>
+        /// <param name="colors">Colors of the curves to display, for each child entry.</param>
         public GUIAnimVec2Entry(GUIAnimFieldLayouts layouts, string path, Color[] colors)
             : base(layouts, path,  new[] { ".x", ".y" }, colors)
         { }
 
+        /// <inheritdoc/>
         public override void SetValue(object value)
         {
             if (value == null)
@@ -547,12 +679,22 @@ namespace BansheeEditor
         }
     }
 
+    /// <summary>
+    /// Creates a GUI for displaying a Vector3 curve field in the animation field display GUI element.
+    /// </summary>
     internal class GUIAnimVec3Entry : GUIAnimComplexEntry
     {
+        /// <summary>
+        /// Constructs a new animation field entry and appends the necessary GUI elements to the provided layouts.
+        /// </summary>
+        /// <param name="layouts">Layouts to append the GUI elements to.</param>
+        /// <param name="path">Path of the curve field.</param>
+        /// <param name="colors">Colors of the curves to display, for each child entry.</param>
         public GUIAnimVec3Entry(GUIAnimFieldLayouts layouts, string path, Color[] colors)
             : base(layouts, path, new[] { ".x", ".y", ".z" }, colors)
         { }
 
+        /// <inheritdoc/>
         public override void SetValue(object value)
         {
             if (value == null)
@@ -565,12 +707,22 @@ namespace BansheeEditor
         }
     }
 
+    /// <summary>
+    /// Creates a GUI for displaying a Vector4 curve field in the animation field display GUI element.
+    /// </summary>
     internal class GUIAnimVec4Entry : GUIAnimComplexEntry
     {
+        /// <summary>
+        /// Constructs a new animation field entry and appends the necessary GUI elements to the provided layouts.
+        /// </summary>
+        /// <param name="layouts">Layouts to append the GUI elements to.</param>
+        /// <param name="path">Path of the curve field.</param>
+        /// <param name="colors">Colors of the curves to display, for each child entry.</param>
         public GUIAnimVec4Entry(GUIAnimFieldLayouts layouts, string path, Color[] colors)
             : base(layouts, path,  new[] { ".x", ".y", ".z", ".w" }, colors)
         { }
 
+        /// <inheritdoc/>
         public override void SetValue(object value)
         {
             if (value == null)
@@ -584,12 +736,22 @@ namespace BansheeEditor
         }
     }
 
+    /// <summary>
+    /// Creates a GUI for displaying a Color curve field in the animation field display GUI element.
+    /// </summary>
     internal class GUIAnimColorEntry : GUIAnimComplexEntry
     {
+        /// <summary>
+        /// Constructs a new animation field entry and appends the necessary GUI elements to the provided layouts.
+        /// </summary>
+        /// <param name="layouts">Layouts to append the GUI elements to.</param>
+        /// <param name="path">Path of the curve field.</param>
+        /// <param name="colors">Colors of the curves to display, for each child entry.</param>
         public GUIAnimColorEntry(GUIAnimFieldLayouts layouts, string path, Color[] colors)
             : base(layouts, path, new[] { ".r", ".g", ".b", ".a" }, colors)
         { }
 
+        /// <inheritdoc/>
         public override void SetValue(object value)
         {
             if (value == null)
@@ -603,6 +765,10 @@ namespace BansheeEditor
         }
     }
 
+    /// <summary>
+    /// Creates a GUI for displaying an entry in the animation field display GUI element that notifies the user that
+    /// a referenced curve field path cannot be found.
+    /// </summary>
     internal class GUIAnimMissingEntry : GUIAnimFieldEntry
     {
         private GUILabel missingLabel;
@@ -622,6 +788,7 @@ namespace BansheeEditor
             layouts.overlay.AddElement(overlaySpacing);
         }
 
+        /// <inheritdoc/>
         public override void Toggle(bool on)
         {
             underlayLayout.Active = on;
@@ -631,6 +798,9 @@ namespace BansheeEditor
         }
     }
 
+    /// <summary>
+    /// Contains information required to display a single curve field entry in the animation field display GUI.
+    /// </summary>
     internal struct AnimFieldInfo
     {
         public AnimFieldInfo(string path, FieldAnimCurves curveGroup, bool isUserCurve)

+ 173 - 1
Source/MBansheeEditor/Windows/AnimationWindow.cs

@@ -13,7 +13,8 @@ namespace BansheeEditor
      */
 
     /// <summary>
-    /// Displays animation curve editor window.
+    /// Displays animation curve editor window. Allows the user to manipulate keyframes of animation curves, add/remove
+    /// curves from an animation clip, and manipulate animation events.
     /// </summary>
     [DefaultSize(900, 500)]
     internal class AnimationWindow : EditorWindow
@@ -116,6 +117,9 @@ namespace BansheeEditor
         private GUIAnimFieldDisplay guiFieldDisplay;
         private GUICurveEditor guiCurveEditor;
 
+        /// <summary>
+        /// Recreates the entire curve editor GUI depending on the currently selected scene object.
+        /// </summary>
         private void RebuildGUI()
         {
             GUI.Clear();
@@ -377,6 +381,11 @@ namespace BansheeEditor
             UpdateScrollBarSize();
         }
 
+        /// <summary>
+        /// Resizes GUI elements so they fit within the provided boundaries.
+        /// </summary>
+        /// <param name="width">Width of the GUI bounds, in pixels.</param>
+        /// <param name="height">Height of the GUI bounds, in pixels.</param>
         private void ResizeGUI(int width, int height)
         {
             guiFieldDisplay.SetSize(FIELD_DISPLAY_WIDTH, height - buttonLayoutHeight * 2);
@@ -400,6 +409,9 @@ namespace BansheeEditor
 
         private float zoomAmount;
 
+        /// <summary>
+        /// Handles mouse scroll wheel and dragging events in order to zoom or drag the displayed curve editor contents.
+        /// </summary>
         private void HandleDragAndZoomInput()
         {
             // Handle middle mouse dragging
@@ -434,6 +446,11 @@ namespace BansheeEditor
             }
         }
 
+        /// <summary>
+        /// Moves or resizes the vertical scroll bar under the curve editor.
+        /// </summary>
+        /// <param name="position">New position of the scrollbar, in range [0, 1].</param>
+        /// <param name="size">New size of the scrollbar handle, in range [0, 1].</param>
         private void SetVertScrollbarProperties(float position, float size)
         {
             Vector2 visibleRange = guiCurveEditor.Range;
@@ -450,6 +467,11 @@ namespace BansheeEditor
             guiCurveEditor.Offset = offset;
         }
 
+        /// <summary>
+        /// Moves or resizes the horizontal scroll bar under the curve editor.
+        /// </summary>
+        /// <param name="position">New position of the scrollbar, in range [0, 1].</param>
+        /// <param name="size">New size of the scrollbar handle, in range [0, 1].</param>
         private void SetHorzScrollbarProperties(float position, float size)
         {
             Vector2 visibleRange = guiCurveEditor.Range;
@@ -466,6 +488,9 @@ namespace BansheeEditor
             guiCurveEditor.Offset = offset;
         }
 
+        /// <summary>
+        /// Updates the size of both scrollbars depending on the currently visible curve area vs. the total curve area.
+        /// </summary>
         private void UpdateScrollBarSize()
         {
             Vector2 visibleRange = guiCurveEditor.Range;
@@ -475,6 +500,9 @@ namespace BansheeEditor
             vertScrollBar.HandleSize = visibleRange.y / totalRange.y;
         }
 
+        /// <summary>
+        /// Updates the position of both scrollbars depending on the offset currently applied to the visible curve area.
+        /// </summary>
         private void UpdateScrollBarPosition()
         {
             Vector2 visibleRange = guiCurveEditor.Range;
@@ -500,6 +528,10 @@ namespace BansheeEditor
                 vertScrollBar.Position = 0.0f;
         }
 
+        /// <summary>
+        /// Calculates the width/height of the curve area depending on the current zoom level.
+        /// </summary>
+        /// <returns>Width/height of the curve area, in curve space (value, time).</returns>
         private Vector2 GetZoomedRange()
         {
             float zoomLevel = MathEx.Pow(2, zoomAmount);
@@ -508,6 +540,10 @@ namespace BansheeEditor
             return optimalRange / zoomLevel;
         }
 
+        /// <summary>
+        /// Returns the total width/height of the contents of the curve area.
+        /// </summary>
+        /// <returns>Width/height of the curve area, in curve space (value, time).</returns>
         private Vector2 GetTotalRange()
         {
             // Return optimal range (that covers the visible curve)
@@ -518,6 +554,12 @@ namespace BansheeEditor
             return Vector2.Max(optimalRange, zoomedRange);
         }
 
+        /// <summary>
+        /// Zooms in or out at the provided position in the curve display.
+        /// </summary>
+        /// <param name="curvePos">Position to zoom towards, relative to the curve display area, in curve space 
+        ///                        (value, time)</param>
+        /// <param name="amount">Amount to zoom in (positive), or out (negative).</param>
         private void Zoom(Vector2 curvePos, float amount)
         {
             // Increase or decrease the visible range depending on zoom level
@@ -550,6 +592,11 @@ namespace BansheeEditor
         #region Curve save/load
         private EditorAnimClipInfo clipInfo;
 
+        /// <summary>
+        /// Refreshes the contents of the curve and property display by loading animation curves from the provided
+        /// animation clip.
+        /// </summary>
+        /// <param name="clip">Clip containing the animation to load.</param>
         private void LoadAnimClip(AnimationClip clip)
         {
             EditorPersistentData persistentData = EditorApplication.PersistentData;
@@ -580,6 +627,11 @@ namespace BansheeEditor
             FPS = clipInfo.sampleRate;
         }
 
+        /// <summary>
+        /// Checks if the currently selected object has changed, and rebuilds the GUI and loads the animation clip if needed.
+        /// </summary>
+        /// <param name="force">If true the GUI rebuild and animation clip load will be forced regardless if the active
+        ///                     scene object changed.</param>
         private void UpdateSelectedSO(bool force)
         {
             SceneObject so = Selection.SceneObject;
@@ -635,12 +687,20 @@ namespace BansheeEditor
         private int currentFrameIdx;
         private int fps = 1;
 
+        /// <summary>
+        /// Sampling rate of the animation in frames per second. Determines granularity at which positions keyframes can be
+        /// placed.
+        /// </summary>
         internal int FPS
         {
             get { return fps; }
             set { guiCurveEditor.SetFPS(value); fps = MathEx.Max(value, 1); }
         }
 
+        /// <summary>
+        /// Changes the currently selected frame in the curve display.
+        /// </summary>
+        /// <param name="frameIdx">Index of the frame to select.</param>
         private void SetCurrentFrame(int frameIdx)
         {
             currentFrameIdx = Math.Max(0, frameIdx);
@@ -711,6 +771,10 @@ namespace BansheeEditor
             guiFieldDisplay.SetDisplayValues(values.ToArray());
         }
 
+        /// <summary>
+        /// Returns a list of all animation curves that should be displayed in the curve display.
+        /// </summary>
+        /// <returns>Array of curves to display.</returns>
         private CurveDrawInfo[] GetDisplayedCurves()
         {
             List<CurveDrawInfo> curvesToDisplay = new List<CurveDrawInfo>();
@@ -739,6 +803,10 @@ namespace BansheeEditor
             return curvesToDisplay.ToArray();
         }
 
+        /// <summary>
+        /// Returns width/height required to show the entire contents of the currently displayed curves.
+        /// </summary>
+        /// <returns>Width/height of the curve area, in curve space (value, time).</returns>
         private Vector2 GetOptimalRange()
         {
             CurveDrawInfo[] curvesToDisplay = GetDisplayedCurves();
@@ -760,6 +828,9 @@ namespace BansheeEditor
             return new Vector2(xRange, yRange);
         }
 
+        /// <summary>
+        /// Calculates an unique color for each animation curve.
+        /// </summary>
         private void UpdateCurveColors()
         {
             int globalCurveIdx = 0;
@@ -770,6 +841,12 @@ namespace BansheeEditor
             }
         }
 
+        /// <summary>
+        /// Updates the curve display with currently selected curves.
+        /// </summary>
+        /// <param name="allowReduce">Normally the curve display will expand if newly selected curves cover a larger area
+        ///                           than currently available, but the area won't be reduced if the selected curves cover
+        ///                           a smaller area. Set this to true to allow the area to be reduced.</param>
         private void UpdateDisplayedCurves(bool allowReduce = false)
         {
             CurveDrawInfo[] curvesToDisplay = GetDisplayedCurves();
@@ -792,6 +869,11 @@ namespace BansheeEditor
         #region Field display
         private List<string> selectedFields = new List<string>();
 
+        /// <summary>
+        /// Registers a new animation curve field.
+        /// </summary>
+        /// <param name="path">Path of the field, see <see cref="GUIFieldSelector.OnElementSelected"/></param>
+        /// <param name="type">Type of the field (float, vector, etc.)</param>
         private void AddNewField(string path, SerializableProperty.FieldType type)
         {
             bool noSelection = selectedFields.Count == 0;
@@ -887,6 +969,12 @@ namespace BansheeEditor
             UpdateDisplayedCurves(noSelection);
         }
 
+        /// <summary>
+        /// Selects a new animation curve field, making the curve display in the curve display GUI element.
+        /// </summary>
+        /// <param name="path">Path of the field to display.</param>
+        /// <param name="additive">If true the field will be shown along with any already selected fields, or if false
+        ///                        only the provided field will be shown.</param>
         private void SelectField(string path, bool additive)
         {
             if (!additive)
@@ -904,6 +992,9 @@ namespace BansheeEditor
             UpdateDisplayedCurves(noSelection);
         }
 
+        /// <summary>
+        /// Deletes all currently selecting fields, removing them their curves permanently.
+        /// </summary>
         private void RemoveSelectedFields()
         {
             for (int i = 0; i < selectedFields.Count; i++)
@@ -917,6 +1008,9 @@ namespace BansheeEditor
             UpdateDisplayedCurves();
         }
 
+        /// <summary>
+        /// Updates the GUI element displaying the current animation curve fields.
+        /// </summary>
         private void UpdateDisplayedFields()
         {
             List<AnimFieldInfo> existingFields = new List<AnimFieldInfo>();
@@ -928,6 +1022,10 @@ namespace BansheeEditor
         #endregion
 
         #region Helpers
+        /// <summary>
+        /// Returns the size of the curve editor GUI element.
+        /// </summary>
+        /// <returns>Width/height of the curve editor, in pixels.</returns>
         private Vector2I GetCurveEditorSize()
         {
             Vector2I output = new Vector2I();
@@ -937,8 +1035,16 @@ namespace BansheeEditor
             return output;
         }
 
+        /// <summary>
+        /// Calculates the total range covered by a set of curves.
+        /// </summary>
+        /// <param name="curveInfos">Curves to calculate range for.</param>
+        /// <param name="xRange">Maximum time value present in the curves.</param>
+        /// <param name="yRange">Maximum absolute curve value present in the curves.</param>
         private static void CalculateRange(CurveDrawInfo[] curveInfos, out float xRange, out float yRange)
         {
+            // Note: This only evaluates at keyframes, we should also evaluate in-between in order to account for steep
+            // tangents
             xRange = 0.0f;
             yRange = 0.0f;
 
@@ -954,6 +1060,13 @@ namespace BansheeEditor
             }
         }
 
+        /// <summary>
+        /// Attempts to find a curve field at the specified path.
+        /// </summary>
+        /// <param name="path">Path of the curve field to look for.</param>
+        /// <param name="curveInfos">One or multiple curves found for the specific path (one field can have multiple curves
+        ///                          if it is a complex type, like a vector).</param>
+        /// <returns>True if the curve field was found, false otherwise.</returns>
         private bool TryGetCurve(string path, out CurveDrawInfo[] curveInfos)
         {
             int index = path.LastIndexOf(".");
@@ -1006,6 +1119,12 @@ namespace BansheeEditor
             return false;
         }
 
+        /// <summary>
+        /// Checks if one curve field path a parent of the other.
+        /// </summary>
+        /// <param name="child">Path to check if it is a child of <paramref name="parent"/>.</param>
+        /// <param name="parent">Path to check if it is a parent of <paramref name="child"/>.</param>
+        /// <returns>True if <paramref name="child"/> is a child of <paramref name="parent"/>.</returns>
         private bool IsPathParent(string child, string parent)
         {
             string[] childEntries = child.Split('/', '.');
@@ -1024,6 +1143,12 @@ namespace BansheeEditor
             return true;
         }
 
+        /// <summary>
+        /// If a path has sub-elements (e.g. .x, .r), returns a path without those elements. Otherwise returns the original
+        /// path.
+        /// </summary>
+        /// <param name="path">Path to check.</param>
+        /// <returns>Path without sub-elements.</returns>
         private string GetSubPathParent(string path)
         {
             int index = path.LastIndexOf(".");
@@ -1036,6 +1161,10 @@ namespace BansheeEditor
         #endregion
 
         #region Input callbacks
+        /// <summary>
+        /// Triggered when the user presses a mouse button.
+        /// </summary>
+        /// <param name="ev">Information about the mouse press event.</param>
         private void OnPointerPressed(PointerEvent ev)
         {
             guiCurveEditor.OnPointerPressed(ev);
@@ -1052,6 +1181,10 @@ namespace BansheeEditor
             }
         }
 
+        /// <summary>
+        /// Triggered when the user moves the mouse.
+        /// </summary>
+        /// <param name="ev">Information about the mouse move event.</param>
         private void OnPointerMoved(PointerEvent ev)
         {
             guiCurveEditor.OnPointerMoved(ev);
@@ -1078,6 +1211,10 @@ namespace BansheeEditor
             }
         }
 
+        /// <summary>
+        /// Triggered when the user releases a mouse button.
+        /// </summary>
+        /// <param name="ev">Information about the mouse release event.</param>
         private void OnPointerReleased(PointerEvent ev)
         {
             if (isDragInProgress)
@@ -1092,6 +1229,10 @@ namespace BansheeEditor
             guiCurveEditor.OnPointerReleased(ev);
         }
 
+        /// <summary>
+        /// Triggered when the user releases a keyboard button.
+        /// </summary>
+        /// <param name="ev">Information about the keyboard release event.</param>
         private void OnButtonUp(ButtonEvent ev)
         {
             guiCurveEditor.OnButtonUp(ev);
@@ -1099,6 +1240,11 @@ namespace BansheeEditor
         #endregion
 
         #region General callbacks
+        /// <summary>
+        /// Triggered by the field selector, when user selects a new curve field.
+        /// </summary>
+        /// <param name="path">Path of the selected curve field.</param>
+        /// <param name="type">Type of the selected curve field (float, vector, etc.).</param>
         private void OnFieldAdded(string path, SerializableProperty.FieldType type)
         {
             // Remove the root scene object from the path (we know which SO it is, no need to hardcode its name in the path)
@@ -1112,32 +1258,58 @@ namespace BansheeEditor
             AddNewField(pathNoRoot, type);
         }
 
+        /// <summary>
+        /// Triggered when the user moves or resizes the horizontal scrollbar.
+        /// </summary>
+        /// <param name="position">New position of the scrollbar, in range [0, 1].</param>
+        /// <param name="size">New size of the scrollbar, in range [0, 1].</param>
         private void OnHorzScrollOrResize(float position, float size)
         {
             SetHorzScrollbarProperties(position, size);
         }
 
+        /// <summary>
+        /// Triggered when the user moves or resizes the vertical scrollbar.
+        /// </summary>
+        /// <param name="position">New position of the scrollbar, in range [0, 1].</param>
+        /// <param name="size">New size of the scrollbar, in range [0, 1].</param>
         private void OnVertScrollOrResize(float position, float size)
         {
             SetVertScrollbarProperties(position, size);
         }
 
+        /// <summary>
+        /// Triggered when the user selects a new curve field.
+        /// </summary>
+        /// <param name="path">Path of the selected curve field.</param>
         private void OnFieldSelected(string path)
         {
             bool additive = Input.IsButtonHeld(ButtonCode.LeftShift) || Input.IsButtonHeld(ButtonCode.RightShift);
             SelectField(path, additive);
         }
 
+        /// <summary>
+        /// Triggered when the user selects a new scene object or a resource.
+        /// </summary>
+        /// <param name="sceneObjects">Newly selected scene objects.</param>
+        /// <param name="resourcePaths">Newly selected resources.</param>
         private void OnSelectionChanged(SceneObject[] sceneObjects, string[] resourcePaths)
         {
             UpdateSelectedSO(false);
         }
 
+        /// <summary>
+        /// Triggered when the user selects a new frame in the curve display.
+        /// </summary>
+        /// <param name="frameIdx">Index of the selected frame.</param>
         private void OnFrameSelected(int frameIdx)
         {
             SetCurrentFrame(frameIdx);
         }
 
+        /// <summary>
+        /// Triggered when the user changed (add, removed or modified) animation events in the curve display.
+        /// </summary>
         private void OnEventsChanged()
         {
             clipInfo.events = guiCurveEditor.Events;