mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 03:48:56 +00:00
Profile editor - Tweaked data bindings update behavior in editor
This commit is contained in:
1 parent
a19e754f7c
commit
7c394192fd
6 files changed
+76
-15
No files matched your search
@@ -82,6 +82,10 @@ namespace Artemis.Core
|
||||
if (!Enabled)
|
||||
return;
|
||||
|
||||
// Disable data bindings during an override
|
||||
var wasApplyingDataBindings = ApplyDataBindingsEnabled;
|
||||
ApplyDataBindingsEnabled = false;
|
||||
|
||||
UpdateDisplayCondition();
|
||||
|
||||
// Update the layer timeline, this will give us a new delta time which could be negative in case the main segment wrapped back
|
||||
@@ -100,6 +104,9 @@ namespace Artemis.Core
|
||||
var profileElement = Children[index];
|
||||
profileElement.Update(deltaTime);
|
||||
}
|
||||
|
||||
// Restore the old data bindings enabled state
|
||||
ApplyDataBindingsEnabled = wasApplyingDataBindings;
|
||||
}
|
||||
|
||||
protected internal override void UpdateTimelineLength()
|
||||
|
||||
@@ -76,7 +76,7 @@ namespace Artemis.Core
|
||||
var result = new List<ILayerProperty>();
|
||||
result.AddRange(General.GetAllLayerProperties());
|
||||
result.AddRange(Transform.GetAllLayerProperties());
|
||||
if (LayerBrush?.BaseProperties != null)
|
||||
if (LayerBrush?.BaseProperties != null)
|
||||
result.AddRange(LayerBrush.BaseProperties.GetAllLayerProperties());
|
||||
foreach (var layerEffect in LayerEffects)
|
||||
{
|
||||
@@ -300,6 +300,10 @@ namespace Artemis.Core
|
||||
if (!Enabled || LayerBrush?.BaseProperties == null || !LayerBrush.BaseProperties.PropertiesInitialized)
|
||||
return;
|
||||
|
||||
// Disable data bindings during an override
|
||||
var wasApplyingDataBindings = ApplyDataBindingsEnabled;
|
||||
ApplyDataBindingsEnabled = false;
|
||||
|
||||
var beginTime = TimelinePosition;
|
||||
|
||||
if (stickToMainSegment)
|
||||
@@ -330,6 +334,9 @@ namespace Artemis.Core
|
||||
baseLayerEffect.BaseProperties?.Update(delta);
|
||||
baseLayerEffect.Update(delta);
|
||||
}
|
||||
|
||||
// Restore the old data bindings enabled state
|
||||
ApplyDataBindingsEnabled = wasApplyingDataBindings;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@@ -373,7 +380,7 @@ namespace Artemis.Core
|
||||
// No point rendering if the alpha was set to zero by one of the effects
|
||||
if (layerPaint.Color.Alpha == 0)
|
||||
return;
|
||||
|
||||
|
||||
if (!LayerBrush.SupportsTransformation)
|
||||
SimpleRender(layerCanvas, _layerBitmap.Info, layerPaint, layerPath);
|
||||
else if (General.ResizeMode.CurrentValue == LayerResizeMode.Normal)
|
||||
|
||||
@@ -43,8 +43,10 @@ namespace Artemis.Core
|
||||
|
||||
CurrentValue = BaseValue;
|
||||
|
||||
UpdateKeyframes();
|
||||
UpdateDataBindings(deltaTime);
|
||||
if (ProfileElement.ApplyKeyframesEnabled)
|
||||
UpdateKeyframes();
|
||||
if (ProfileElement.ApplyDataBindingsEnabled)
|
||||
UpdateDataBindings(deltaTime);
|
||||
|
||||
OnUpdated();
|
||||
}
|
||||
|
||||
@@ -15,6 +15,9 @@ namespace Artemis.Core
|
||||
{
|
||||
protected RenderProfileElement()
|
||||
{
|
||||
ApplyDataBindingsEnabled = true;
|
||||
ApplyKeyframesEnabled = true;
|
||||
|
||||
LayerEffectStore.LayerEffectAdded += LayerEffectStoreOnLayerEffectAdded;
|
||||
LayerEffectStore.LayerEffectRemoved += LayerEffectStoreOnLayerEffectRemoved;
|
||||
}
|
||||
@@ -405,6 +408,16 @@ namespace Artemis.Core
|
||||
set => SetAndNotify(ref _displayCondition, value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets whether keyframes should be applied when this profile element updates
|
||||
/// </summary>
|
||||
public bool ApplyKeyframesEnabled { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets whether data bindings should be applied when this profile element updates
|
||||
/// </summary>
|
||||
public bool ApplyDataBindingsEnabled { get; set; }
|
||||
|
||||
public void UpdateDisplayCondition()
|
||||
{
|
||||
var conditionMet = DisplayCondition == null || DisplayCondition.Evaluate();
|
||||
|
||||
Reference in new issue
Block a user