Merge remote-tracking branch 'origin/master'

This commit is contained in:
Robert committed 2020-10-01 20:36:59 +02:00
commit b7b012f863
7 files changed
+79 -18

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()
+9 -2
View File
@@ -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();