đGraph
A utility for capturing and displaying data in the Graph View
Last updated
A utility for capturing and displaying data in the Graph View
Last updated
This behavior is used in the Unity Editor only for capturing and displaying data in the Timeflow Graph View. Use the Graph tool to help visualize animation for analysis and troubleshoot issues.
To add a Graph tool, right-click on an object in the Timeflow view and select from the context menu: Add Tool > Graph
Please note that this behavior is for analysis only and does not presently provide any utility for baking, converting, or exporting data.
Graph can be used in one of two ways; either use Channel Link to route data into the Graph channel, or use scripting to send data from your own custom scripts. Both methods are explained in more detail below.
Drag the channel link well to connect the Graph channel with an input source. This can be used to connect to any numeric value channel.
Graph only displays singular float values. If connected to a multi-numeric property, you may select which axis/attribute to display. When connected to an int or other non-float value, it is converted to floating point for display purposes.
Initially the graph data is empty and will not show anything in the Graph View until data has been captured. Select the object to view the Graph settings in the Inspector, which provides the primary controls for recording data.
The Graph component only records values when recording is enabled. Press Start Recording to begin recording values. This also starts playback in the Timeflow view for convenience.
Use the Work Area to capture data in a specific region of time. This is helpful to isolate a specific moment in an animation and to limit data being captured to that time range, while preserving data outside of the range.
Note that when Work Area Only is toggled, it also affects the work area setting in the Timeflow view accordingly. Looping is also disabled in the view so that recording doesn't repeat and overwrite itself, with playback instead stopping at the end of the work area or timeline duration and recording ending.
If enabled, playback resumes from the current time. Otherwise if Resume is disabled, pressing Start Recording rewinds to the beginning of the Work Area if in use, or the beginning of the timeline.
Press this button any time to clear the captured data. If Work Area Only is enabled, only the data in the work area is cleared. This operation is undoable.
If enabled, the data is cleared automatically when recording starts. This is helpful to prevent overlapping captured data.
Data is captured based on the actual frame rate of playback and the Time Tolerance setting in the Timeflow Preferences, as well as the local Update Settings of the Graph behavior. It is possible for example to use Force Framerate or other update setting to capture data at specific time intervals. Unless Strict Tolerance is used, graph data may actually be captured between frames.
Data is displayed in the Graph View similar to other channels, however the graph data cannot be selected or manipulated and is only for display.
Use the shortcut key F to fit the graph data in view.
This method is useful for visualizing data generated from custom scripts to expose otherwise abstract data into a visual form for inspection. This can be helpful to diagnose issues with timing and interpolation that may be too difficult to spot with logging or other debugging methods.
To integrate this with your own custom script, get a reference to the Graph component and simply call RecordValue(float value). Use the above interface in the Graph inspector to start and stop recording, or control it with your script.
Please refer to the Graph component script for further reference and code comments.
Assets/AxonGenesis/Timeflow/Behaviors/Tools/Graph.cs
Graph Example
You may also refer to the example scene provided with a basic scripting example:
Assets/AxonGenesis/Timeflow/Examples/Scenes/Tools/Graph.unity