Layer brushes - Added RGB.NET-based layer brushes

Layer brushes - Added sample RGB.NET-based color brush
Layer properties - Save on gradient edit dialog close
Layer properties - Fix layer brush keyframes not working after changing layer brush
This commit is contained in:
SpoinkyNL committed 2020-05-31 21:58:06 +02:00
1 parent b8f7fb3887
commit efee645bfb
31 files changed
+550 -146

No files matched your search

@@ -2,12 +2,14 @@
using System.Collections.Generic;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media;
using Artemis.Core.Events;
using Artemis.Core.Models.Profile;
using Artemis.Core.Models.Profile.LayerProperties;
using Artemis.Core.Models.Profile.LayerProperties.Attributes;
using Artemis.Core.Plugins.LayerBrush;
using Artemis.Core.Services;
using Artemis.Core.Services.Interfaces;
using Artemis.UI.Events;
@@ -85,7 +87,7 @@ namespace Artemis.UI.Screens.Module.ProfileEditor.LayerProperties
NotifyOfPropertyChange(() => TimeCaretPosition);
}
private void ProfileEditorServiceOnPixelsPerSecondChanged(object? sender, EventArgs e)
private void ProfileEditorServiceOnPixelsPerSecondChanged(object sender, EventArgs e)
{
NotifyOfPropertyChange(nameof(TimeCaretPosition));
}
@@ -128,17 +130,7 @@ namespace Artemis.UI.Screens.Module.ProfileEditor.LayerProperties
LayerPropertyGroups.Add(new LayerPropertyGroupViewModel(ProfileEditorService, layer.General, (PropertyGroupDescriptionAttribute) generalAttribute));
LayerPropertyGroups.Add(new LayerPropertyGroupViewModel(ProfileEditorService, layer.Transform, (PropertyGroupDescriptionAttribute) transformAttribute));
if (layer.LayerBrush != null)
{
// Add the rout group of the brush
// The root group of the brush has no attribute so let's pull one out of our sleeve
var brushDescription = new PropertyGroupDescriptionAttribute
{
Name = layer.LayerBrush.Descriptor.DisplayName,
Description = layer.LayerBrush.Descriptor.Description
};
LayerPropertyGroups.Add(new LayerPropertyGroupViewModel(ProfileEditorService, layer.LayerBrush.BaseProperties, brushDescription));
}
ApplyLayerBrush();
}
else
SelectedLayer = null;
@@ -149,6 +141,17 @@ namespace Artemis.UI.Screens.Module.ProfileEditor.LayerProperties
private void SelectedLayerOnLayerBrushUpdated(object sender, EventArgs e)
{
ApplyLayerBrush();
}
public void ApplyLayerBrush()
{
var hideRenderRelatedProperties = SelectedLayer.LayerBrush != null && SelectedLayer.LayerBrush.BrushType == LayerBrushType.RgbNet;
SelectedLayer.General.ShapeType.IsHidden = hideRenderRelatedProperties;
SelectedLayer.General.FillType.IsHidden = hideRenderRelatedProperties;
SelectedLayer.General.BlendMode.IsHidden = hideRenderRelatedProperties;
SelectedLayer.Transform.IsHidden = hideRenderRelatedProperties;
// Get rid of the old layer properties group
if (LayerPropertyGroups.Count == 3)
{
@@ -167,6 +170,8 @@ namespace Artemis.UI.Screens.Module.ProfileEditor.LayerProperties
};
LayerPropertyGroups.Add(new LayerPropertyGroupViewModel(ProfileEditorService, SelectedLayer.LayerBrush.BaseProperties, brushDescription));
}
TimelineViewModel.UpdateKeyframes();
}
#endregion