Layer properties - Fixed some checks

This commit is contained in:
SpoinkyNL committed 2020-08-03 23:58:46 +02:00
1 parent 10e9e9446a
commit 7b1cefca8b
3 files changed
+5 -10

No files matched your search

@@ -40,8 +40,8 @@ namespace Artemis.Core.Models.Profile.LayerProperties.Attributes
public object MaxInputValue { get; set; }
/// <summary>
/// Whether or not keyframes are supported, true by default and cannot be changed at runtime
/// Whether or not keyframes are always disabled
/// </summary>
public bool KeyframesSupported { get; set; } = true;
public bool DisableKeyframes { get; set; }
}
}
@@ -156,14 +156,9 @@ namespace Artemis.Core.Models.Profile
instance.ProfileElement = profileElement;
instance.Parent = this;
instance.PropertyDescription = (PropertyDescriptionAttribute) propertyDescription;
if (!instance.KeyframesSupported && instance.PropertyDescription.KeyframesSupported)
{
throw new ArtemisPluginException($"Failed to create instance of layer property at {path + propertyInfo.Name}. " +
$"In the description attribute {nameof(instance.KeyframesSupported)} is set to true but this layer property type " +
"does not support keyframes.");
}
if (instance.PropertyDescription.DisableKeyframes)
instance.KeyframesSupported = false;
instance.KeyframesSupported = instance.PropertyDescription.KeyframesSupported;
InitializeProperty(profileElement, path + propertyInfo.Name, instance);
propertyInfo.SetValue(this, instance);