Add support for multiple media events on audio, postfx and camera tracks in Scene Animations
#519
This commit is contained in:
@@ -114,6 +114,11 @@ namespace FlaxEditor.GUI.Timeline
|
||||
/// </summary>
|
||||
public event Action StartFrameChanged;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the end frame of the media (start + duration).
|
||||
/// </summary>
|
||||
public int EndFrame => _startFrame + _durationFrames;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the total duration of the media event in the timeline sequence frames amount.
|
||||
/// </summary>
|
||||
@@ -175,6 +180,11 @@ namespace FlaxEditor.GUI.Timeline
|
||||
/// </summary>
|
||||
public object PropertiesEditObject;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether this media can be split.
|
||||
/// </summary>
|
||||
public bool CanSplit;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Media"/> class.
|
||||
/// </summary>
|
||||
@@ -258,6 +268,22 @@ namespace FlaxEditor.GUI.Timeline
|
||||
Width = Duration * Timeline.UnitsPerSecond * _timeline.Zoom;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Splits the media at the specified frame.
|
||||
/// </summary>
|
||||
/// <param name="frame">The frame to split at.</param>
|
||||
/// <returns>The another media created after this media split.</returns>
|
||||
public virtual Media Split(int frame)
|
||||
{
|
||||
var clone = (Media)Activator.CreateInstance(GetType());
|
||||
clone.StartFrame = frame;
|
||||
clone.DurationFrames = EndFrame - frame;
|
||||
DurationFrames = DurationFrames - clone.DurationFrames;
|
||||
Track?.AddMedia(clone);
|
||||
Timeline?.MarkAsEdited();
|
||||
return clone;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void GetDesireClientArea(out Rectangle rect)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user