-
Notifications
You must be signed in to change notification settings - Fork 36
/
prefs_blender_rhubarb.py
35 lines (28 loc) · 1.17 KB
/
prefs_blender_rhubarb.py
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
import bpy
from bpy.types import AddonPreferences
from bpy.props import StringProperty
from bpy.props import EnumProperty
from platform import system
class RhubarbAddonPreferences(AddonPreferences):
bl_idname = __package__
executable_path : StringProperty(
name="Rhubarb lipsync executable",
subtype='FILE_PATH',
default=bpy.utils.user_resource('SCRIPTS', path="addons") + '/blender-rhubarb-lipsync/bin/rhubarb' + ('.exe' if system() == 'Windows' else '')
)
recognizer : EnumProperty(
name = "Recognizer",
items = [
("pocketSphinx", "pocketSphinx", "PocketSphinx is an open-source speech recognition library that generally gives good results for English."),
("phonetic", "phonetic", "This recognizer is language-independent. Use it if your recordings are not in English.")
],
default = "pocketSphinx"
)
def draw(self, context):
layout = self.layout
layout.prop(self, "executable_path")
layout.prop(self, "recognizer")
def register():
bpy.utils.register_class(RhubarbAddonPreferences)
def unregister():
bpy.utils.unregister_class(RhubarbAddonPreferences)