-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathShiftCloneEffect.cs
More file actions
141 lines (121 loc) · 6.22 KB
/
Copy pathShiftCloneEffect.cs
File metadata and controls
141 lines (121 loc) · 6.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using YukkuriMovieMaker.Commons;
using YukkuriMovieMaker.Controls;
using YukkuriMovieMaker.Exo;
using YukkuriMovieMaker.Player.Video;
using YukkuriMovieMaker.Plugin.Effects;
namespace ShiftCloneEffectPlugin
{
/// <summary>
/// 映像エフェクト
/// 映像エフェクトには必ず[VideoEffect]属性を設定してください。
/// </summary>
[VideoEffect("時間差複製エフェクト", new[] { "配置" }, new string[] { }, isAviUtlSupported:false)]
public class ShiftCloneEffect : VideoEffectBase
{
/// <summary>
/// エフェクトの名前
/// </summary>
public override string Label => "時間差複製エフェクト";
/// <summary>
/// アイテム編集エリアに表示するエフェクトの設定項目。
/// [Display]と[AnimationSlider]等のアイテム編集コントロール属性の2つを設定する必要があります。
/// [AnimationSlider]以外のアイテム編集コントロール属性の一覧はSamplePropertyEditorsプロジェクトを参照してください。
/// </summary>
[Display(GroupName = "描画", Name = "手前に複製", Description = "ON:クローンが手前に重なっていく。\nOFF:クローンが奥に重なっていく。")]
[ToggleSlider]
public bool Order { get => order; set => Set(ref order, value); }
bool order = true;
[Display(GroupName = "描画", Name = "X成分間隔", Description = "X成分間隔")]
[AnimationSlider("F1", "px", -500, 500)]
public Animation X { get; } = new Animation(0, -10000, 10000);
[Display(GroupName = "描画", Name = "Y成分間隔", Description = "Y成分間隔")]
[AnimationSlider("F1", "px", -500, 500)]
public Animation Y { get; } = new Animation(0, -10000, 10000);
[Display(GroupName = "描画", Name = "総表示個数", Description = "総表示個数")]
[TextBoxSlider("F0", "個", 0, 10)]
[DefaultValue(4)]
[Range(1, 255)]
public int Max { get => max; set => Set(ref max, value); }
int max = 4;
[Display(GroupName = "生成", Name = "生成時間間隔", Description = "生成時間間隔。\n0ミリ秒で単純複製します。")]
[TextBoxSlider("F1", "ミリ秒", 0, 500)]
[DefaultValue(0d)]
[Range(0, 10000)]
public float DeltaTime { get => deltaTime; set => Set(ref deltaTime, value); }
float deltaTime = 0;
[Display(GroupName = "生成", Name = "初期生成個数", Description = "初期生成個数")]
[TextBoxSlider("F0", "個", 0, 10)]
[DefaultValue(0)]
[Range(0, 255)]
public int BeginNum { get => beginNum; set => Set(ref beginNum, value); }
int beginNum = 0;
[Display(GroupName = "生成", Name = "フェードイン", Description = "フェードイン")]
[TextBoxSlider("F2", "秒", 0, 1)]
[DefaultValue(0d)]
[Range(0, 10)]
public float FadeIn { get => fadeIn; set => Set(ref fadeIn, value); }
float fadeIn = 0;
[Display(GroupName = "生成", Name = "初期半透明化", Description = "初期半透明化")]
[ToggleSlider]
public bool BeginOp { get => beginOp; set => Set(ref beginOp, value); }
bool beginOp = false;
[Display(GroupName = "消去", Name = "消去モード", Description = "消去モード")]
[EnumComboBox]
public DeleteModeEnum DeleteMode { get => deleteMode; set => Set(ref deleteMode, value); }
DeleteModeEnum deleteMode = DeleteModeEnum.Straight;
[Display(GroupName = "消去", Name = "消去時間間隔", Description = "消去時間間隔。\n0ミリ秒で消去なし。")]
[TextBoxSlider("F1", "ミリ秒", 0, 500)]
[DefaultValue(0d)]
[Range(0, 10000)]
public float DeleteTime { get => deleteTime; set => Set(ref deleteTime, value); }
float deleteTime = 0;
[Display(GroupName = "消去", Name = "終了直後個数", Description = "終了直後個数")]
[TextBoxSlider("F0", "個", 0, 10)]
[DefaultValue(0)]
[Range(0, 255)]
public int LeaveNum { get => leaveNum; set => Set(ref leaveNum, value); }
int leaveNum = 0;
[Display(GroupName = "消去", Name = "フェードアウト", Description = "フェードアウト")]
[TextBoxSlider("F2", "秒", 0, 1)]
[DefaultValue(0d)]
[Range(0, 10)]
public float FadeOut { get => fadeOut; set => Set(ref fadeOut, value); }
float fadeOut = 0;
[Display(GroupName = "消去", Name = "終了半透明化", Description = "終了半透明化")]
[ToggleSlider]
public bool EndOp { get => endOp; set => Set(ref endOp, value); }
bool endOp = false;
/// <summary>
/// Exoフィルタを作成する。
/// </summary>
/// <param name="keyFrameIndex">キーフレーム番号</param>
/// <param name="exoOutputDescription">exo出力に必要な各種情報</param>
/// <returns></returns>
public override IEnumerable<string> CreateExoVideoFilters(int keyFrameIndex, ExoOutputDescription exoOutputDescription)
{
//サンプルはSampleD2DVideoEffectを参照
return Enumerable.Empty<string>();
}
/// <summary>
/// 映像エフェクトを作成する
/// </summary>
/// <param name="devices">デバイス</param>
/// <returns>映像エフェクト</returns>
public override IVideoEffectProcessor CreateVideoEffect(IGraphicsDevicesAndContext devices)
{
return new ShiftCloneEffectProcessor(devices, this);
}
/// <summary>
/// クラス内のIAnimatableを列挙する。
/// </summary>
/// <returns></returns>
protected override IEnumerable<IAnimatable> GetAnimatables() => new[] { X, Y };
}
}