From 10e9e9446a101ac79e9f9dc8b39665f5f1da7047 Mon Sep 17 00:00:00 2001 From: SpoinkyNL Date: Mon, 3 Aug 2020 00:18:42 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=98=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Artemis.Core/Models/Profile/LayerPropertyGroup.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Artemis.Core/Models/Profile/LayerPropertyGroup.cs b/src/Artemis.Core/Models/Profile/LayerPropertyGroup.cs index e20d958ae..70893bc8f 100644 --- a/src/Artemis.Core/Models/Profile/LayerPropertyGroup.cs +++ b/src/Artemis.Core/Models/Profile/LayerPropertyGroup.cs @@ -156,6 +156,13 @@ 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."); + } + instance.KeyframesSupported = instance.PropertyDescription.KeyframesSupported; InitializeProperty(profileElement, path + propertyInfo.Name, instance); @@ -230,7 +237,7 @@ namespace Artemis.Core.Models.Profile // let properties subscribe to the update event and update themselves OnPropertyGroupUpdating(); } - + private void InitializeProperty(RenderProfileElement profileElement, string path, BaseLayerProperty instance) { Guid pluginGuid;