blender-voicevox-pl/__init__.py

49 lines
1.1 KiB
Python

"""
Blender VoiceVox Plugin
VoiceVoxを使用した音声合成と字幕表示を同時に行うBlenderアドオン
"""
import bpy
from . import operators
from . import operators_reference
from . import operators_speaker
from . import panels
from . import properties
classes = (
properties.VoiceVoxProperties,
operators.VOICEVOX_OT_generate_speech,
operators.VOICEVOX_OT_add_subtitle,
operators.VOICEVOX_OT_test_connection,
operators_reference.VOICEVOX_OT_set_reference_text,
operators_reference.VOICEVOX_OT_clear_reference_text,
operators_speaker.VOICEVOX_OT_refresh_speakers,
panels.VOICEVOX_PT_main_panel,
)
def register():
"""アドオンを登録"""
for cls in classes:
bpy.utils.register_class(cls)
bpy.types.Scene.voicevox = bpy.props.PointerProperty(type=properties.VoiceVoxProperties)
try:
properties.update_speaker_cache()
except:
pass
def unregister():
"""アドオンを登録解除"""
for cls in reversed(classes):
bpy.utils.unregister_class(cls)
del bpy.types.Scene.voicevox
if __name__ == "__main__":
register()