Profile editor - Redesigned adding/removing timeline segments

General module - Added some basic window information to the data model
Profiles - Don't render when opacity is 0
Profile editor - Render non-selected layers in their main segment
Profile editor - Condition editor fixes
This commit is contained in:
SpoinkyNL committed 2020-07-24 23:04:21 +02:00
1 parent 732ee2f429
commit 64a1010100
39 files changed
+831 -261

No files matched your search

@@ -42,6 +42,7 @@ namespace Artemis.UI.Shared.Services
// Update to populate children
viewModel.Update(this);
viewModel.UpdateRequested += (sender, args) => viewModel.Update(this);
return viewModel;
}
@@ -56,6 +57,7 @@ namespace Artemis.UI.Shared.Services
// Update to populate children
viewModel.Update(this);
viewModel.UpdateRequested += (sender, args) => viewModel.Update(this);
return viewModel;
}
@@ -185,6 +187,7 @@ namespace Artemis.UI.Shared.Services
if (initialValue == null)
initialValue = Activator.CreateInstance(registration.SupportedType);
}
// This assumes the type can be converted, that has been checked when the VM was created
if (initialValue != null && initialValue.GetType() != registration.SupportedType)
initialValue = Convert.ChangeType(initialValue, registration.SupportedType);
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using Artemis.Core.Models.Profile;
using Artemis.Core.Models.Profile.LayerProperties;
using Artemis.Core.Plugins.Abstract;
using Artemis.Core.Plugins.Models;
using Artemis.UI.Shared.Events;
@@ -53,7 +54,7 @@ namespace Artemis.UI.Shared.Services.Interfaces
/// Occurs when the current editor time is changed
/// </summary>
event EventHandler CurrentTimeChanged;
/// <summary>
/// Occurs when the pixels per second (zoom level) is changed
/// </summary>
@@ -76,11 +77,16 @@ namespace Artemis.UI.Shared.Services.Interfaces
void RemovePropertyInput(PropertyInputRegistration registration);
/// <summary>
/// Snaps the given time to the closest relevant element in the timeline, this can be the cursor, a keyframe or a segment end.
/// Snaps the given time to the closest relevant element in the timeline, this can be the cursor, a keyframe or a
/// segment end.
/// </summary>
/// <param name="time"></param>
/// <param name="tolerance">How close the time must be to snap</param>
/// <param name="snapToSegments">Enable snapping to timeline segments</param>
/// <param name="snapToCurrentTime">Enable snapping to the current time of the editor</param>
/// <param name="snapToKeyframes">Enable snapping to visible keyframes</param>
/// <param name="excludedKeyframe">A keyframe to exclude during keyframe snapping</param>
/// <returns></returns>
TimeSpan SnapToTimeline(TimeSpan time, TimeSpan tolerance, bool snapToSegments, bool snapToCurrentTime, bool snapToKeyframes);
TimeSpan SnapToTimeline(TimeSpan time, TimeSpan tolerance, bool snapToSegments, bool snapToCurrentTime, bool snapToKeyframes, BaseLayerPropertyKeyframe excludedKeyframe = null);
}
}
@@ -113,20 +113,11 @@ namespace Artemis.UI.Shared.Services
if (SelectedProfile == null)
return;
var delta = CurrentTime - _lastUpdateTime;
foreach (var folder in SelectedProfile.GetAllFolders())
{
foreach (var baseLayerEffect in folder.LayerEffects)
baseLayerEffect.Update(delta.TotalSeconds);
}
foreach (var layer in SelectedProfile.GetAllLayers())
{
layer.OverrideProgress(CurrentTime);
layer.LayerBrush?.Update(delta.TotalSeconds);
foreach (var baseLayerEffect in layer.LayerEffects)
baseLayerEffect.Update(delta.TotalSeconds);
}
// Stick to the main segment for any element that is not currently selected
foreach (var folder in SelectedProfile.GetAllFolders())
folder.OverrideProgress(CurrentTime, folder != SelectedProfileElement);
foreach (var layer in SelectedProfile.GetAllLayers())
layer.OverrideProgress(CurrentTime, layer != SelectedProfileElement);
_lastUpdateTime = CurrentTime;
OnProfilePreviewUpdated();
@@ -205,7 +196,7 @@ namespace Artemis.UI.Shared.Services
}
}
public TimeSpan SnapToTimeline(TimeSpan time, TimeSpan tolerance, bool snapToSegments, bool snapToCurrentTime, bool snapToKeyframes)
public TimeSpan SnapToTimeline(TimeSpan time, TimeSpan tolerance, bool snapToSegments, bool snapToCurrentTime, bool snapToKeyframes, BaseLayerPropertyKeyframe excludedKeyframe = null)
{
if (snapToSegments)
{