条件によって効かない項目を設定の画面で隠す
・円形の開口では羽根枚数と開口回転を、線形光がオフではハイライトの2項目を表示しないよう変更-M
このコミットが含まれているのは:
2ファイル変更
+39
検索条件に一致するファイルはありません
@@ -33,10 +33,12 @@ public sealed class WaveOpticsEffect : VideoEffectBase
|
||||
private bool _linear;
|
||||
|
||||
[Display(GroupName = nameof(Texts.OutputGroup), Name = nameof(Texts.HighlightThreshold), Description = nameof(Texts.HighlightThresholdDescription), Order = 3, ResourceType = typeof(Texts))]
|
||||
[LinearLightVisible]
|
||||
[AnimationSlider("F1", "%", 0, 100)]
|
||||
public Animation HighlightThreshold { get; } = new(95, 0, 100);
|
||||
|
||||
[Display(GroupName = nameof(Texts.OutputGroup), Name = nameof(Texts.HighlightBoost), Description = nameof(Texts.HighlightBoostDescription), Order = 4, ResourceType = typeof(Texts))]
|
||||
[LinearLightVisible]
|
||||
[AnimationSlider("F1", "x", 1, 100)]
|
||||
public Animation HighlightBoost { get; } = new(1, 1, 1000);
|
||||
|
||||
@@ -75,6 +77,7 @@ public sealed class WaveOpticsEffect : VideoEffectBase
|
||||
private WaveOpticsApertureShape _apertureShape;
|
||||
|
||||
[Display(GroupName = nameof(Texts.ApertureGroup), Name = nameof(Texts.BladeCount), Description = nameof(Texts.BladeCountDescription), Order = 21, ResourceType = typeof(Texts))]
|
||||
[PolygonApertureVisible]
|
||||
[TextBoxSlider("F0", "", 3, 16)]
|
||||
[Range(3, 32)]
|
||||
[DefaultValue(6)]
|
||||
@@ -82,6 +85,7 @@ public sealed class WaveOpticsEffect : VideoEffectBase
|
||||
private int _bladeCount = 6;
|
||||
|
||||
[Display(GroupName = nameof(Texts.ApertureGroup), Name = nameof(Texts.BladeRotation), Description = nameof(Texts.BladeRotationDescription), Order = 22, ResourceType = typeof(Texts))]
|
||||
[PolygonApertureVisible]
|
||||
[AnimationSlider("F1", "°", -180, 180)]
|
||||
public Animation BladeRotation { get; } = new(0, -360, 360);
|
||||
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
using System.Globalization;
|
||||
using System.Windows;
|
||||
using System.Windows.Data;
|
||||
using YukkuriMovieMaker.ItemEditor;
|
||||
|
||||
namespace WaveOptics.Effects;
|
||||
|
||||
[AttributeUsage(AttributeTargets.Property)]
|
||||
internal sealed class PolygonApertureVisibleAttribute : Attribute, ICustomVisibilityAttribute2
|
||||
{
|
||||
public Binding GetBinding(object item, object propertyOwner) => new(nameof(WaveOpticsEffect.ApertureShape))
|
||||
{
|
||||
Source = item,
|
||||
Converter = new VisibilityConverter(value => value is WaveOpticsApertureShape.RegularPolygon)
|
||||
};
|
||||
}
|
||||
|
||||
[AttributeUsage(AttributeTargets.Property)]
|
||||
internal sealed class LinearLightVisibleAttribute : Attribute, ICustomVisibilityAttribute2
|
||||
{
|
||||
public Binding GetBinding(object item, object propertyOwner) => new(nameof(WaveOpticsEffect.Linear))
|
||||
{
|
||||
Source = item,
|
||||
Converter = new VisibilityConverter(value => value is true)
|
||||
};
|
||||
}
|
||||
|
||||
internal sealed class VisibilityConverter(Func<object?, bool> isVisible) : IValueConverter
|
||||
{
|
||||
public object Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
|
||||
=> isVisible(value) ? Visibility.Visible : Visibility.Collapsed;
|
||||
|
||||
public object ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
|
||||
=> throw new NotSupportedException();
|
||||
}
|
||||
新しいイシューから参照
ユーザーをブロックする