### CreateExoVideoFilters example implementation Source: https://ymm-api-docs.vercel.app/reference/m%3Ayukkurimoviemaker.plugin.effects.ivideoeffect.createexovideofilters%28system.int32%2Cyukkurimoviemaker.exo.exooutputdescription%29 Example implementation of CreateExoVideoFilters that generates a blur filter string for AviUtl. Uses the output FPS and the Blur.ToExoString helper to format the range parameter. ```csharp public override IEnumerable CreateExoVideoFilters(int keyFrameIndex, ExoOutputDescription exoOutputDescription) { var fps = exoOutputDescription.VideoInfo.FPS; yield return $"_name=ぼかし\r\n" + $"_disable={(IsEnabled ? 1 : 0)}\r\n" + $"範囲={Blur.ToExoString(keyFrameIndex, "F0", fps)}\r\n"; } ``` -------------------------------- ### Update method example using with expression Source: https://ymm-api-docs.vercel.app/reference/t%3Ayukkurimoviemaker.player.video.drawdescription Shows how to return a modified DrawDescription from IVideoEffectProcessor.Update, using the 'with' expression to change only the Opacity property. The example multiplies the existing opacity by 0.5. ```csharp public DrawDescription Update(EffectDescription effectDescription) { return effectDescription.DrawDescription with { Opacity = effectDescription.DrawDescription.Opacity * 0.5 }; } ``` -------------------------------- ### SampleToolView.xaml.cs - コードビハインド Source: https://ymm-api-docs.vercel.app/guide/extension/ui_extension/itool/what-is-itool SampleToolViewのコードビハインド。InitializeComponentを呼び出すだけの最小実装。 ```cs using System.Windows.Controls; namespace YourNamespace { public partial class SampleToolView : UserControl { public SampleToolView() { InitializeComponent(); } } } ``` -------------------------------- ### Start Property Source: https://ymm-api-docs.vercel.app/reference/p%3Ayukkurimoviemaker.commons.exoitem.start Gets or sets the start frame number of the item. This property is of type System.Int32. ```APIDOC ## Start Property ### Description Gets or sets the start frame number of the item. ### Declaration ```csharp public Int32 Start { get; set; } ``` ### Property Value System.Int32 ### Remarks - Namespace: YukkuriMovieMaker.Commons - Assembly: YukkuriMovieMaker.Plugin.dll ``` -------------------------------- ### TranscriptionSegment.Start Property Source: https://ymm-api-docs.vercel.app/reference/p%3Ayukkurimoviemaker.plugin.transcription.transcriptionsegment.start Gets or sets the start time of the transcription segment. This property is required and of type System.TimeSpan. ```APIDOC ## TranscriptionSegment.Start Property ### Description Gets or sets the start time of the transcription segment. ### Declaration ```csharp public required TimeSpan Start { get; set; } ``` ### Property Value - **Type**: System.TimeSpan - **Required**: Yes ### Remarks This property is part of the `YukkuriMovieMaker.Plugin.Transcription.TranscriptionSegment` class in the `YukkuriMovieMaker.Plugin.dll` assembly. ``` -------------------------------- ### Initialize Source: https://ymm-api-docs.vercel.app/reference/yukkuri-movie-maker/plugin/i-setting/method/initialize ISetting インターフェースの Initialize メソッドのドキュメント。設定値を初期化するために呼び出されます。 ```APIDOC ## Initialize ### Description 設定値を初期化します。 ### Method Initialize ### Signature ```csharp void Initialize(); ``` ### Return Value System.Void ### Remarks `SettingsBase` のロード処理が完了した後に呼び出されます。 JSONからデシリアライズされた直後、または新規インスタンス作成直後に呼ばれます。 バージョン間の移行処理や初期値の補完に使用してください。 ``` -------------------------------- ### Time Property Source: https://ymm-api-docs.vercel.app/reference/p%3Ayukkurimoviemaker.commons.lipsyncframe.time Gets the time when this mouth shape starts. The time is relative to the beginning of the audio clip. ```APIDOC ## Time Property ### Description Gets the time when this mouth shape starts. The time is relative to the beginning of the audio clip. ### Declaration ```csharp public TimeSpan Time { get; init; } ``` ### Property Value System.TimeSpan ### Remarks YMM4 applies the mouth shape of `Shape` from this time until before the `Time` of the next frame. ``` -------------------------------- ### SampleToolPlugin.cs - IToolPluginの実装 Source: https://ymm-api-docs.vercel.app/guide/extension/ui_extension/itool/what-is-itool YMM4の「ツール」メニューに登録されるツールプラグインのエントリポイント。Name、AllowMultipleInstances、ViewModelType、ViewTypeを定義する。 ```cs using System; using YukkuriMovieMaker.Plugin; namespace YourNamespace { public class SampleToolPlugin : IToolPlugin { // YMM4の「ツール」メニューに表示される名前 public string Name => "サンプルツール"; // ツールウィンドウの複数同時起動を許可するかどうか public bool AllowMultipleInstances => false; // ツールのUIロジックを担当するViewModelの型 public Type ViewModelType => typeof(SampleToolViewModel); // ツールの見た目(UI)を担当するView(UserControl)の型 public Type ViewType => typeof(SampleToolView); } } ``` -------------------------------- ### ItemPosition Property Source: https://ymm-api-docs.vercel.app/reference/p%3Ayukkurimoviemaker.player.video.timelineitemsourcedescription.itemposition Gets the start position of the timeline item in frame time. This property is declared on the TimelineItemSourceDescription class and is initialized via an init accessor. ```APIDOC ## ItemPosition Property ### Description Gets the start position of the timeline item in frame time. ### Declaration ```csharp public FrameTime ItemPosition { get; init; } ``` ### Property Value Type: `YukkuriMovieMaker.Player.Video.FrameTime` ### Remarks - Declaring Type: `YukkuriMovieMaker.Player.Video.TimelineItemSourceDescription` - Assembly: `YukkuriMovieMaker.Plugin.dll` ``` -------------------------------- ### void Initialize() Source: https://ymm-api-docs.vercel.app/reference/m%3Ayukkurimoviemaker.plugin.isetting.initialize Initializes setting values. This method is called after the SettingsBase load process completes, either immediately after deserialization from JSON or after creating a new instance. Use it for version migration and completing initial values. ```APIDOC ## void Initialize() ### Description Initializes setting values. This method is called after the SettingsBase load process completes, either immediately after deserialization from JSON or after creating a new instance. Use it for version migration and completing initial values. ### Method Initialize ### Signature void Initialize(); ### Return Value System.Void ### Remarks `SettingsBase` のロード処理が完了した後に呼び出されます。 JSONからデシリアライズされた直後、または新規インスタンス作成直後に呼ばれます。 バージョン間の移行処理や初期値の補完に使用してください。 ``` -------------------------------- ### String Name { get; } Source: https://ymm-api-docs.vercel.app/reference/yukkuri-movie-maker/plugin/voice/i-voice-resource/property/name Gets the display name of the voice resource. This property is read-only and returns a System.String. ```APIDOC ## String Name { get; } ### Description Gets the display name of the voice resource. ### Declaration ```csharp String Name { get; } ``` ### Property Value - **Type**: System.String - **Description**: The display name of the resource. ``` -------------------------------- ### SampleToolViewModel.cs - INotifyPropertyChangedの実装 Source: https://ymm-api-docs.vercel.app/guide/extension/ui_extension/itool/what-is-itool ツールのUIロジックを担当するViewModel。INotifyPropertyChangedを実装し、Messageプロパティの変更を通知する。 ```cs using System.ComponentModel; using System.Runtime.CompilerServices; namespace YourNamespace { public class SampleToolViewModel : INotifyPropertyChanged { private string _message = "こんにちは、YMM4!"; public string Message { get => _message; set { if (_message != value) { _message = value; OnPropertyChanged(); } } } public event PropertyChangedEventHandler? PropertyChanged; protected void OnPropertyChanged([CallerMemberName] string? propertyName = null) { PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); } } } ``` -------------------------------- ### SampleSettingsPlugin.cs - ISettingsPlugin の実装 Source: https://ymm-api-docs.vercel.app/guide/extension/ui_extension/isettings/what-is-isettings YMM4の環境設定ウィンドウにタブを追加するためのプラグインクラスです。Name プロパティでタブ名を指定し、Settings プロパティで設定データを保持するインスタンスを返します。 ```cs using YukkuriMovieMaker.Plugin; namespace YourNamespace { public class SampleSettingsPlugin : ISettingsPlugin { // 環境設定ウィンドウのタブに表示される名前 public string Name => "サンプル設定"; // 設定データを保持するインスタンス public object Settings => SampleSettings.Default; } } ``` -------------------------------- ### SupportedTextFormat Format { get; } Source: https://ymm-api-docs.vercel.app/reference/p%3Ayukkurimoviemaker.plugin.voice.ivoicespeaker.format Gets the text format supported by this speaker. The property returns a SupportedTextFormat value. ```APIDOC ## SupportedTextFormat Format { get; } ### Description Gets the text format supported by this speaker. ### Property Declaration ```csharp SupportedTextFormat Format { get; } ``` ### Property Value - **Type**: YukkuriMovieMaker.Plugin.Voice.SupportedTextFormat - **Description**: The text format supported by the speaker. ### Remarks - **Declaring Type**: YukkuriMovieMaker.Plugin.Voice.IVoiceSpeaker - **Assembly**: YukkuriMovieMaker.Plugin.dll ``` -------------------------------- ### InitializeAsync Source: https://ymm-api-docs.vercel.app/reference/t%3Ayukkurimoviemaker.plugin.voiceactivitydetector.ivoiceactivitydetector 検出器を非同期に初期化するメソッド。 ```APIDOC ## InitializeAsync ### Description 検出器を非同期に初期化します。 ### Method InitializeAsync ### Signature ```csharp Task InitializeAsync(CancellationToken token); ``` ### Parameters - **token** (System.Threading.CancellationToken) - Required - キャンセルトークン。 ### Returns System.Threading.Tasks.Task ### Remarks モデルのロードなど重い初期化処理をここで行います。`DownloadResourcesAsync` の後に呼ばれます。 ``` -------------------------------- ### string Remark { get; set; } Source: https://ymm-api-docs.vercel.app/reference/p%3Ayukkurimoviemaker.plugin.effects.iaudioeffect.remark Gets or sets the remark string associated with the effect. This property is part of the IAudioEffect interface. ```APIDOC ## Property: Remark ### Description Gets or sets the remark string associated with the effect. ### Declaration ```csharp string Remark { get; set; } ``` ### Property Value System.String ### Applies to YukkuriMovieMaker.Plugin.Effects.IAudioEffect ``` -------------------------------- ### GetValue usage example Source: https://ymm-api-docs.vercel.app/reference/m%3Ayukkurimoviemaker.commons.animation.getvalue%28system.int64%2Csystem.int64%2Csystem.int32%29 Example of calling GetValue with effect description properties: ItemPosition.Frame, ItemDuration.Frame, and FPS. The return value is clamped between MinValue and MaxValue. ```csharp double value = Intensity.GetValue( effectDescription.ItemPosition.Frame, effectDescription.ItemDuration.Frame, effectDescription.FPS); ``` -------------------------------- ### SampleHLSLShaderVideoEffectProcessor: IVideoEffectProcessorを実装する Source: https://ymm-api-docs.vercel.app/example/sample/video-effect YMM4のHLSLシェーダーエフェクト用のプロセッサークラス。コンストラクタでシェーダーカスタムエフェクトを初期化し、IsEnabledでGPU読み込み失敗を判定してリソースを解放します。OutputプロパティはEffectから取得したものを必ずDisposeする必要があります。SetInput/ClearInputで入力画像を管理し、Updateでパラメータを更新、Disposeでリソースを解放します。 ```cs using Vortice.Direct2D1; using YukkuriMovieMaker.Commons; using YukkuriMovieMaker.Player.Video; namespace YMM4SamplePlugin.VideoEffect.SampleHLSLShaderVideoEffect { internal class SampleHLSLShaderVideoEffectProcessor : IVideoEffectProcessor { readonly SampleHLSLShaderVideoEffect item; bool isFirst = true; double value; readonly SampleHLSLShaderCustomEffect? effect; readonly ID2D1Image? output; ID2D1Image? input; /// /// エフェクトの出力画像 /// public ID2D1Image Output => output ?? input ?? throw new NullReferenceException(); public SampleHLSLShaderVideoEffectProcessor(IGraphicsDevicesAndContext devices, SampleHLSLShaderVideoEffect item) { this.item = item; effect = new SampleHLSLShaderCustomEffect(devices); if (!effect.IsEnabled) { //GPU性能によってエフェクトの読み込みに失敗することがある effect.Dispose(); effect = null; } else { output = effect.Output;//EffectからgetしたOutputは必ずDisposeする必要がある。Effect内部では開放されない。 } } /// /// エフェクトの入力画像を変更する /// /// public void SetInput(ID2D1Image? input) { this.input = input; effect?.SetInput(0, input, true); } /// /// エフェクトの入力画像をクリアする /// public void ClearInput() { effect?.SetInput(0, null, true); } /// /// エフェクトを更新する /// /// エフェクトの描画に必要な各種情報 /// 描画位置等 public DrawDescription Update(EffectDescription effectDescription) { if (effect is null) return effectDescription.DrawDescription; var frame = effectDescription.ItemPosition.Frame; var length = effectDescription.ItemDuration.Frame; var fps = effectDescription.FPS; var value = item.Value.GetValue(frame, length, fps) / 100; if (isFirst || this.value != value) effect.Value = (float)value; isFirst = false; this.value = value; return effectDescription.DrawDescription; } /// /// エフェクトの各種リソースを開放する /// public void Dispose() { output?.Dispose();//EffectからgetしたOutputは必ずDisposeする必要がある。Effect内部では開放されない。 effect?.SetInput(0, null, true);//Inputは必ずnullに戻す。 effect?.Dispose(); } } } ``` -------------------------------- ### GetValue usage example Source: https://ymm-api-docs.vercel.app/reference/t%3Ayukkurimoviemaker.commons.animation Example usage of GetValue to retrieve the interpolated value of an Intensity animation at the current frame. Uses effectDescription properties for frame, totalFrame, and FPS. ```csharp double value = Intensity.GetValue( effectDescription.ItemPosition.Frame, effectDescription.ItemDuration.Frame, effectDescription.FPS); ``` -------------------------------- ### GetChildProgress usage example Source: https://ymm-api-docs.vercel.app/reference/m%3Ayukkurimoviemaker.commons.progressmessage.getchildprogress%28system.double%2Csystem.double%29 Shows how to create two child progress messages for separate download steps and report progress for each. ```csharp var step1 = progress.GetChildProgress(0.0, 0.5); var step2 = progress.GetChildProgress(0.5, 1.0); await DownloadStep1Async(step1); await DownloadStep2Async(step2); ``` -------------------------------- ### csprojにHLSLコンパイルターゲットを追加する Source: https://ymm-api-docs.vercel.app/example/sample/video-effect HLSLファイルを自動的にコンパイルし、CSOファイルを埋め込みリソースとして含めるためのMSBuildターゲット。fxc.exeのパスを自動解決し、見つからない場合はエラーを表示します。 ```xml $(IntermediateOutputPath)Shaders\ $([System.IO.Path]::Combine('$(WindowsSdkDir)', 'bin', '$(TargetPlatformVersion)', 'x64', 'fxc.exe')) fxc.exe $(RootNamespace).Shaders.%(Filename)%(Extension) ``` -------------------------------- ### VideoEffectCategories.Camera Source: https://ymm-api-docs.vercel.app/reference/yukkuri-movie-maker/plugin/effects/video-effect-categories Gets the key for the camera category. ```APIDOC ## VideoEffectCategories.Camera ### Description Gets the key for the camera category. ### Field - **Camera** (System.String) - The key for the camera category. ### Value `"YMM4Key_EffectCategoryCameraName"` ### Usage Use this constant in the `categories` argument of `VideoEffectAttribute`. ``` -------------------------------- ### SampleToolView.xaml - ツールUIのXAML Source: https://ymm-api-docs.vercel.app/guide/extension/ui_extension/itool/what-is-itool ツールの見た目を定義するUserControlのXAML。TextBoxとTextBlockをMessageプロパティにバインドしている。 ```xml ``` -------------------------------- ### Instance Source: https://ymm-api-docs.vercel.app/reference/t%3Ayukkurimoviemaker.plugin.thememanager InstanceプロパティのAPIドキュメント。ThemeManagerのシングルトンインスタンスを取得します。 ```APIDOC ## Instance ### Description ThemeManagerのシングルトンインスタンスを取得します。 ### Property Signature public static ThemeManager Instance { get; } ### Property Value YukkuriMovieMaker.Plugin.ThemeManager ``` -------------------------------- ### VideoEffectCategories.Branch Source: https://ymm-api-docs.vercel.app/reference/yukkuri-movie-maker/plugin/effects/video-effect-categories Gets the key for the branch category. ```APIDOC ## VideoEffectCategories.Branch ### Description Gets the key for the branch category. ### Field - **Branch** (System.String) - The key for the branch category. ### Value `"YMM4Key_EffectCategoryBranchName"` ### Usage Use this constant in the `categories` argument of `VideoEffectAttribute`. ``` -------------------------------- ### VideoEffectCategories.Animation Source: https://ymm-api-docs.vercel.app/reference/yukkuri-movie-maker/plugin/effects/video-effect-categories Gets the key for the animation category. ```APIDOC ## VideoEffectCategories.Animation ### Description Gets the key for the animation category. ### Field - **Animation** (System.String) - The key for the animation category. ### Value `"YMM4Key_EffectCategoryAnimationName"` ### Usage Use this constant in the `categories` argument of `VideoEffectAttribute`. ``` -------------------------------- ### SampleSettings.cs - INotifyPropertyChanged と Display 属性の実装 Source: https://ymm-api-docs.vercel.app/guide/extension/ui_extension/isettings/what-is-isettings 設定データを保持するクラスです。Display 属性でUIの表示名と説明を指定し、INotifyPropertyChanged を実装して変更通知を行います。トグルボタンとテキストボックスの設定項目を定義しています。 ```cs using System.ComponentModel; using System.Runtime.CompilerServices; using YukkuriMovieMaker.Controls; namespace YourNamespace { public class SampleSettings : INotifyPropertyChanged { private static SampleSettings? _default; public static SampleSettings Default => _default ??= new SampleSettings(); private bool _isEnabled = false; private string _userName = "名無し"; // トグルボタン(チェックボックス)として表示される設定 [Display(Name = "機能の有効化", Description = "サンプル機能を有効にします。")] public bool IsEnabled { get => _isEnabled; set { if (_isEnabled != value) { _isEnabled = value; OnPropertyChanged(); } } } // テキストボックスとして表示される設定 [Display(Name = "ユーザー名", Description = "プラグインで使用する名前です。")] public string UserName { get => _userName; set { if (_userName != value) { _userName = value; OnPropertyChanged(); } } } public event PropertyChangedEventHandler? PropertyChanged; protected void OnPropertyChanged([CallerMemberName] string? propertyName = null) { PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); } } } ``` -------------------------------- ### Animation.MinValue Source: https://ymm-api-docs.vercel.app/reference/yukkuri-movie-maker/commons/animation Gets the minimum value of the parameter. ```APIDOC ## Animation.MinValue ### Description Gets the minimum value of the parameter. ### Property csharp [JsonIgnore] public double MinValue { get; } ### Property Value - **Type**: System.Double ``` -------------------------------- ### CreateShapeItemExoFilterで図形アイテムのexo出力を定義する Source: https://ymm-api-docs.vercel.app/example/sample/shape 図形アイテムとしてexo出力する際のAviUtl向けフィルタ文字列を返す。アニメーション値はToExoStringで変換する。CreateMaskExoFilterではマスク用のフィルタを返す。exo出力に対応しない場合はIShapePlugin側のIsExoShapeSupportedやIsExoMaskSupportedをfalseにし、各関数で空配列を返す。 ```cs public override IEnumerable CreateShapeItemExoFilter(int keyFrameIndex, ExoOutputDescription desc) { var fps = desc.VideoInfo.FPS; return [ $"_name=図形\r\n" + $"サイズ={Size.ToExoString(keyFrameIndex, "F0", fps)}\r\n" + $"縦横比=0\r\n" + $"ライン幅=4000\r\n" + $"type=0\r\n" + $"color=FFFFFF\r\n" + $"name=\r\n" ]; } ``` -------------------------------- ### Animation.MaxValue Source: https://ymm-api-docs.vercel.app/reference/yukkuri-movie-maker/commons/animation Gets the maximum value of the parameter. ```APIDOC ## Animation.MaxValue ### Description Gets the maximum value of the parameter. ### Property csharp [JsonIgnore] public double MaxValue { get; } ### Property Value - **Type**: System.Double ``` -------------------------------- ### IVoiceResource.DownloadAsync Source: https://ymm-api-docs.vercel.app/reference/m%3Ayukkurimoviemaker.plugin.voice.ivoiceresource.downloadasync%28yukkurimoviemaker.commons.progressmessage%29 このメソッドは、IVoiceResource インターフェースの一部として、リソースを非同期にダウンロードします。進捗は ProgressMessage を使用して報告し、ダウンロード開始前に DownloadStarted イベントを発火する必要があります。 ```APIDOC ## [PROCEDURE] DownloadAsync ### Description リソースを非同期にダウンロードします。 ### Method DownloadAsync ### Signature `Task DownloadAsync(ProgressMessage progress)` ### Parameters - **progress** (YukkuriMovieMaker.Commons.ProgressMessage) - Required - 進捗を報告するためのオブジェクト。 ### Return Value System.Threading.Tasks.Task ### Remarks `progress.Report(rate, message)` で進捗を報告してください。`rate` は 0.0〜1.0 です。 ダウンロード開始前に `DownloadStarted` イベントを発火してください。 ``` -------------------------------- ### VideoEffectBase() Source: https://ymm-api-docs.vercel.app/reference/m%3Ayukkurimoviemaker.plugin.effects.videoeffectbase.%23ctor Initializes a new instance of the VideoEffectBase class. This constructor is public and returns void. ```APIDOC ## VideoEffectBase() ### Description Initializes a new instance of the VideoEffectBase class. ### Method Constructor ### Signature ```csharp public VideoEffectBase() ``` ### Parameters None ### Returns System.Void ``` -------------------------------- ### Animation.DefaultValue Source: https://ymm-api-docs.vercel.app/reference/yukkuri-movie-maker/commons/animation Gets the default value of the parameter. ```APIDOC ## Animation.DefaultValue ### Description Gets the default value of the parameter. ### Property csharp [JsonIgnore] public double DefaultValue { get; } ### Property Value - **Type**: System.Double ``` -------------------------------- ### string Source: https://ymm-api-docs.vercel.app/example/sample/video-effect string ```string string ``` -------------------------------- ### Label Source: https://ymm-api-docs.vercel.app/reference/t%3Ayukkurimoviemaker.plugin.effects.iaudioeffect Gets the display name of the effect. ```APIDOC ## Label ### Description Gets the display name of the effect. ### Property string Label { get; } ### Property Value System.String ``` -------------------------------- ### InitializeAsync Source: https://ymm-api-docs.vercel.app/reference/yukkuri-movie-maker/plugin/voice-activity-detector/i-voice-activity-detector Asynchronously initializes the voice activity detector. ```APIDOC ## InitializeAsync ### Description Asynchronously initializes the detector. ### Method InitializeAsync ### Signature ```csharp Task InitializeAsync(CancellationToken token); ``` ### Parameters - **token** (System.Threading.CancellationToken) - Required - Cancellation token. ### Returns - System.Threading.Tasks.Task ### Remarks Perform heavy initialization such as model loading here. Called after `DownloadResourcesAsync`. ``` -------------------------------- ### Hz Source: https://ymm-api-docs.vercel.app/reference/t%3Ayukkurimoviemaker.player.audio.effects.iaudiostream Gets the sampling rate in Hz. ```APIDOC ## IAudioStream.Hz ### Description Gets the sampling rate in Hz. ### Property ```csharp Int32 Hz { get; } ``` ### Property Value - **System.Int32** - The sampling rate in Hz. ```