forked from scaredyfish/blender-rhubarb-lipsync
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathprefs.py
47 lines (38 loc) · 1.3 KB
/
prefs.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
36
37
38
39
40
41
42
43
44
45
46
47
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")
+ "\\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)