""" プロパティ定義 アドオンで使用する設定値やパラメータを定義 """ import bpy from bpy.props import ( StringProperty, IntProperty, FloatProperty, BoolProperty, EnumProperty, ) class VoiceVoxProperties(bpy.types.PropertyGroup): """VoiceVoxプラグインのプロパティ""" # VoiceVox エンジンの設定 voicevox_host: StringProperty( name="VoiceVox Host", description="VoiceVoxエンジンのホストアドレス", default="127.0.0.1", ) voicevox_port: IntProperty( name="VoiceVox Port", description="VoiceVoxエンジンのポート番号", default=50021, min=1, max=65535, ) # 音声合成の設定 text: StringProperty( name="Text", description="音声合成するテキスト", default="", ) speaker_id: IntProperty( name="Speaker ID", description="話者ID (VoiceVoxのキャラクター)", default=0, min=0, ) speed_scale: FloatProperty( name="Speed", description="話速", default=1.0, min=0.5, max=2.0, ) pitch_scale: FloatProperty( name="Pitch", description="音高", default=0.0, min=-0.15, max=0.15, ) intonation_scale: FloatProperty( name="Intonation", description="抑揚", default=1.0, min=0.0, max=2.0, ) volume_scale: FloatProperty( name="Volume", description="音量", default=1.0, min=0.0, max=2.0, ) # 字幕の設定 subtitle_font_size: IntProperty( name="Font Size", description="字幕のフォントサイズ", default=48, min=12, max=200, ) subtitle_position_y: FloatProperty( name="Position Y", description="字幕の垂直位置 (0.0 = 下, 1.0 = 上)", default=0.1, min=0.0, max=1.0, ) # チャンネル設定 audio_channel: IntProperty( name="Audio Channel", description="音声を配置するチャンネル番号", default=1, min=1, max=128, ) subtitle_channel: IntProperty( name="Subtitle Channel", description="字幕を配置するチャンネル番号", default=2, min=1, max=128, ) # 出力設定 output_directory: StringProperty( name="Output Directory", description="音声ファイルの出力先ディレクトリ", default="//audio_cache/", subtype='DIR_PATH', ) auto_add_to_sequencer: BoolProperty( name="Auto Add to Sequencer", description="生成した音声と字幕を自動的にシーケンサーに追加", default=True, )